Member since
09-29-2017
6
Posts
0
Kudos Received
0
Solutions
10-03-2017
02:09 PM
Can you please suggest any other way as we cannot install any software.
... View more
10-03-2017
02:05 PM
Any suggestion on this?
... View more
09-30-2017
04:35 PM
I'm trying to connect from windows to Linux server which has kerborised hiveserver2.through jdbc connectivity.Can you please suggest me on this?
... View more
09-30-2017
03:31 PM
import java.io.*; import java.util.*; import java.sql.*; import org.apache.*; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.Statement; import org.apache.hadoop.security.UserGroupInformation; publicclass helloworld { publicstaticvoid main(String[] args)throwsSQLException,ClassNotFoundException,InstantiationException,IllegalAccessException{ Driver hiveDriver; Connection con; String connection_string; Properties props =newProperties(); connection_string ="jdbc:hive2://****/default;principal=mapr/*****;kerberosAuthType=fromSubject"; System.out.println("Full connection string is: "+ connection_string ); hiveDriver =(Driver)Class.forName("org.apache.hive.jdbc.HiveDriver").newInstance(); System.out.println("BEFORE"); con = hiveDriver.connect( connection_string, props ); System.out.println("AFTER"); Statement stmt = con.createStatement(); // See if show tables works ResultSet res; String sql ="show tables"; System.out.println("Running: "+ sql); stmt.executeQuery(sql); System.out.println("Done with show tables"); } } While executing the code i'm getting kerberos user_name: prompt and while giving the user name and password im getting error as could not open client transport jdbc uri
... View more
09-30-2017
03:30 PM
import java.io.*;
import java.util.*;
import java.sql.*;
import org.apache.*;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
import org.apache.hadoop.security.UserGroupInformation;
public class helloworld {
public static void main(String[] args) throws SQLException,ClassNotFoundException,InstantiationException,IllegalAccessException {
Driver hiveDriver;
Connection con;
String connection_string;
Properties props = new Properties();
connection_string = "jdbc:hive2://****/default;principal=mapr/*****;kerberosAuthType=fromSubject";
System.out.println( "Full connection string is: " + connection_string );
hiveDriver = (Driver)Class.forName("org.apache.hive.jdbc.HiveDriver").newInstance();
System.out.println("BEFORE");
con = hiveDriver.connect( connection_string, props );
System.out.println("AFTER");
Statement stmt = con.createStatement();
// See if show tables works
ResultSet res;
String sql = "show tables" ;
System.out.println("Running: " + sql);
stmt.executeQuery(sql);
System.out.println("Done with show tables");
}
}
While executing the code i'm getting kerberos user_name: prompt and while giving the user name and password im getting error as could not open client transport jdbc uri
... View more
09-29-2017
01:46 PM
Getting error as SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Exception in thread "main" java.lang.NullPointerException
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.apache.hadoop.conf.Configuration.getClassByNameOrNull(Configuration.java:2159)
at org.apache.hadoop.conf.Configuration.getClassByName(Configuration.java:2124)
at org.apache.hadoop.security.SecurityUtil.getCustomAuthPrincipal(SecurityUtil.java:634)
at org.apache.hadoop.security.UserGroupInformation.initialize(UserGroupInformation.java:219)
at org.apache.hadoop.security.UserGroupInformation.setConfiguration(UserGroupInformation.java:361)
at org.apache.hadoop.hive.thrift.HadoopThriftAuthBridge25Sasl.createClientWithConf(HadoopThriftAuthBridge25Sasl.java:72)
at org.apache.hadoop.hive.thrift.HadoopThriftAuthBridge25Sasl.createClientWithConf(HadoopThriftAuthBridge25Sasl.java:55)
at org.apache.hive.service.auth.KerberosSaslHelper.getKerberosTransport(KerberosSaslHelper.java:54)
at org.apache.hive.jdbc.HiveConnection.createBinaryTransport(HiveConnection.java:449)
at org.apache.hive.jdbc.HiveConnection.openTransport(HiveConnection.java:202)
at org.apache.hive.jdbc.HiveConnection.<init>(HiveConnection.java:177)
at org.apache.hive.jdbc.HiveDriver.connect(HiveDriver.java:105)
at helloworld.main(helloworld.java:15)
... View more
Labels:
- Labels:
-
Apache Hive