public SessionHandle openSession(String username, String password) throws HiveSQLException { return openSession(username, password, Collections.<String, String>emptyMap()); }
@Test public void testOpenSession() throws Exception { SessionHandle sessionHandle = client.openSession( "tom", "password", Collections.<String, String>emptyMap()); assertNotNull(sessionHandle); client.closeSession(sessionHandle); sessionHandle = client.openSession("tom", "password"); assertNotNull(sessionHandle); client.closeSession(sessionHandle); }
@Test public void testGetInfo() throws Exception { SessionHandle sessionHandle = client.openSession( "tom", "password", Collections.<String, String>emptyMap()); assertNotNull(sessionHandle); GetInfoValue value = client.getInfo(sessionHandle, GetInfoType.CLI_DBMS_NAME); System.out.println(value.getStringValue()); value = client.getInfo(sessionHandle, GetInfoType.CLI_SERVER_NAME); System.out.println(value.getStringValue()); value = client.getInfo(sessionHandle, GetInfoType.CLI_DBMS_VER); System.out.println(value.getStringValue()); client.closeSession(sessionHandle); }
private SessionHandle openSession(Map<String, String> confOverlay) throws HiveSQLException { SessionHandle sessionHandle = client.openSession("tom", "password", confOverlay); assertNotNull(sessionHandle); SessionState.get().setIsHiveServerQuery(true); // Pretend we are in HS2. String queryString = "SET " + HiveConf.ConfVars.HIVE_SUPPORT_CONCURRENCY.varname + " = false"; client.executeStatement(sessionHandle, queryString, confOverlay); return sessionHandle; }
public void testExecuteStatement() throws Exception { HashMap<String, String> confOverlay = new HashMap<String, String>(); SessionHandle sessionHandle = client.openSession( "tom", "password", new HashMap<String, String>()); assertNotNull(sessionHandle);
SessionHandle sessionHandle = client.openSession("tom", "password", new HashMap<String, String>()); assertNotNull(sessionHandle); String tabName = "TEST_CONF_EXEC";
@Test public void testGetFunctions() throws Exception { SessionHandle sessionHandle = client.openSession("tom", "password"); assertNotNull(sessionHandle); OperationHandle opHandle = client.getFunctions(sessionHandle, null, null, "*"); TableSchema schema = client.getResultSetMetadata(opHandle); ColumnDescriptor columnDesc = schema.getColumnDescriptorAt(0); assertEquals("FUNCTION_CAT", columnDesc.getName()); assertEquals(Type.STRING_TYPE, columnDesc.getType()); columnDesc = schema.getColumnDescriptorAt(1); assertEquals("FUNCTION_SCHEM", columnDesc.getName()); assertEquals(Type.STRING_TYPE, columnDesc.getType()); columnDesc = schema.getColumnDescriptorAt(2); assertEquals("FUNCTION_NAME", columnDesc.getName()); assertEquals(Type.STRING_TYPE, columnDesc.getType()); columnDesc = schema.getColumnDescriptorAt(3); assertEquals("REMARKS", columnDesc.getName()); assertEquals(Type.STRING_TYPE, columnDesc.getType()); columnDesc = schema.getColumnDescriptorAt(4); assertEquals("FUNCTION_TYPE", columnDesc.getName()); assertEquals(Type.INT_TYPE, columnDesc.getType()); columnDesc = schema.getColumnDescriptorAt(5); assertEquals("SPECIFIC_NAME", columnDesc.getName()); assertEquals(Type.STRING_TYPE, columnDesc.getType()); // Cleanup client.closeOperation(opHandle); client.closeSession(sessionHandle); }
public SessionHandle openSession(String username, String password) throws HiveSQLException { return openSession(username, password, Collections.<String, String>emptyMap()); }
public SessionHandle openSession(String username, String password) throws HiveSQLException { return openSession(username, password, Collections.<String, String>emptyMap()); }
public SessionHandle openSession(String username, String password) throws HiveSQLException { return openSession(username, password, Collections.<String, String>emptyMap()); }
public SessionHandle openSession(String username, String password) throws HiveSQLException { return openSession(username, password, Collections.<String, String>emptyMap()); }
public SessionHandle openSession(String username, String password) throws HiveSQLException { return openSession(username, password, Collections.<String, String>emptyMap()); }
private void waitForStartup() throws Exception { int waitTime = 0; long startupTimeout = 1000L * 1000000000L; CLIServiceClient hs2Client = getServiceClientInternal(); SessionHandle sessionHandle = null; do { Thread.sleep(500L); waitTime += 500L; if (waitTime > startupTimeout) { throw new TimeoutException("Couldn't access new HiveServer2: " + getJdbcURL()); } try { sessionHandle = hs2Client.openSession("foo", "bar"); } catch (Exception e) { // service not started yet continue; } hs2Client.closeSession(sessionHandle); break; } while (true); }
if (!lensToHiveSession.containsKey(sessionDbKey)) { try { hiveSession = getClient().openSession(ctx.getClusterUser(), "", SESSION_CONF); lensToHiveSession.put(sessionDbKey, hiveSession); log.info("New hive session for user: {} , lens session: {} , hive session handle: {} , driver : {}",
.equals(HiveAuthFactory.AuthTypes.KERBEROS.toString())) { String user = UserGroupInformation.getLoginUser().getUserName(); hiveSession = getClient().openSession(user, "", SESSION_CONF); } else { hiveSession = getClient().openSession(ctx.getClusterUser(), "", SESSION_CONF);