Package org.apache.hive.service.cli

Examples of org.apache.hive.service.cli.SessionHandle


  @Override
  public QueryHandle getColumns(String catalog, String schemaPattern, String tableNamePattern, String columnNamePattern)
    throws ExploreException, SQLException {
    try {
      Map<String, String> sessionConf = startSession();
      SessionHandle sessionHandle = cliService.openSession("", "", sessionConf);
      try {
        OperationHandle operationHandle = cliService.getColumns(sessionHandle, catalog, schemaPattern,
                                                                tableNamePattern, columnNamePattern);
        QueryHandle handle = saveOperationInfo(operationHandle, sessionHandle, sessionConf, "");
        LOG.trace("Retrieving columns: catalog {}, schemaPattern {}, tableNamePattern {}, columnNamePattern {}",
View Full Code Here


  @Override
  public QueryHandle getCatalogs() throws ExploreException, SQLException {
    try {
      Map<String, String> sessionConf = startSession();
      SessionHandle sessionHandle = cliService.openSession("", "", sessionConf);
      try {
        OperationHandle operationHandle = cliService.getCatalogs(sessionHandle);
        QueryHandle handle = saveOperationInfo(operationHandle, sessionHandle, sessionConf, "");
        LOG.trace("Retrieving catalogs");
        return handle;
View Full Code Here

  @Override
  public QueryHandle getSchemas(String catalog, String schemaPattern) throws ExploreException, SQLException {
    try {
      Map<String, String> sessionConf = startSession();
      SessionHandle sessionHandle = cliService.openSession("", "", sessionConf);
      try {
        OperationHandle operationHandle = cliService.getSchemas(sessionHandle, catalog, schemaPattern);
        QueryHandle handle = saveOperationInfo(operationHandle, sessionHandle, sessionConf, "");
        LOG.trace("Retrieving schemas: catalog {}, schema {}", catalog, schemaPattern);
        return handle;
View Full Code Here

  @Override
  public QueryHandle getFunctions(String catalog, String schemaPattern, String functionNamePattern)
    throws ExploreException, SQLException {
    try {
      Map<String, String> sessionConf = startSession();
      SessionHandle sessionHandle = cliService.openSession("", "", sessionConf);
      try {
        OperationHandle operationHandle = cliService.getFunctions(sessionHandle, catalog,
                                                                  schemaPattern, functionNamePattern);
        QueryHandle handle = saveOperationInfo(operationHandle, sessionHandle, sessionConf, "");
        LOG.trace("Retrieving functions: catalog {}, schema {}, function {}",
View Full Code Here

      if (ret != null) {
        return ret;
      }

      Map<String, String> sessionConf = startSession();
      SessionHandle sessionHandle = cliService.openSession("", "", sessionConf);
      try {
        // Convert to GetInfoType
        GetInfoType hiveInfoType = null;
        for (GetInfoType t : GetInfoType.values()) {
          if (t.name().equals("CLI_" + infoType.name())) {
View Full Code Here

  @Override
  public QueryHandle getTables(String catalog, String schemaPattern, String tableNamePattern,
                               List<String> tableTypes) throws ExploreException, SQLException {
    try {
      Map<String, String> sessionConf = startSession();
      SessionHandle sessionHandle = cliService.openSession("", "", sessionConf);
      try {
        OperationHandle operationHandle = cliService.getTables(sessionHandle, catalog, schemaPattern,
                                                               tableNamePattern, tableTypes);
        QueryHandle handle = saveOperationInfo(operationHandle, sessionHandle, sessionConf, "");
        LOG.trace("Retrieving tables: catalog {}, schemaNamePattern {}, tableNamePattern {}, tableTypes {}",
View Full Code Here

  @Override
  public QueryHandle getTableTypes() throws ExploreException, SQLException {
    try {
      Map<String, String> sessionConf = startSession();
      SessionHandle sessionHandle = cliService.openSession("", "", sessionConf);
      try {
        OperationHandle operationHandle = cliService.getTableTypes(sessionHandle);
        QueryHandle handle = saveOperationInfo(operationHandle, sessionHandle, sessionConf, "");
        LOG.trace("Retrieving table types");
        return handle;
View Full Code Here

  @Override
  public QueryHandle getTypeInfo() throws ExploreException, SQLException {
    try {
      Map<String, String> sessionConf = startSession();
      SessionHandle sessionHandle = cliService.openSession("", "", sessionConf);
      try {
        OperationHandle operationHandle = cliService.getTypeInfo(sessionHandle);
        QueryHandle handle = saveOperationInfo(operationHandle, sessionHandle, sessionConf, "");
        LOG.trace("Retrieving type info");
        return handle;
View Full Code Here

  @Override
  public QueryHandle execute(String statement) throws ExploreException, SQLException {
    try {
      Map<String, String> sessionConf = startSession();
      // It looks like the username and password below is not used when security is disabled in Hive Server2.
      SessionHandle sessionHandle = cliService.openSession("", "", sessionConf);
      try {
        OperationHandle operationHandle = doExecute(sessionHandle, statement);
        QueryHandle handle = saveOperationInfo(operationHandle, sessionHandle, sessionConf, statement);
        LOG.trace("Executing statement: {} with handle {}", statement, handle);
        return handle;
View Full Code Here

  }

  @Test
  public void testOpenSession() throws Exception {
    // Open a new client session
    SessionHandle sessHandle = client.openSession(USERNAME,
        PASSWORD, new HashMap<String, String>());
    // Session handle should not be null
    assertNotNull("Session handle should not be null", sessHandle);
    // Close client session
    client.closeSession(sessHandle);
View Full Code Here

TOP

Related Classes of org.apache.hive.service.cli.SessionHandle

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.