public static HiveJdbcConnector newConnectorWithProps(Properties compactRunProps) throws SQLException {

    boolean isSimulate = Boolean.valueOf(compactRunProps.getProperty(HIVE_EXECUTION_SIMULATE));

    HiveJdbcConnector hiveJdbcConnector = new HiveJdbcConnector(isSimulate);

    // Set the Hive Server type
    hiveJdbcConnector.withHiveServerVersion(
        Integer.parseInt(compactRunProps.getProperty(HIVESERVER_VERSION, DEFAULT_HIVESERVER_VERSION)));

    // Add the Hive Site Dir to the classpath
    if (compactRunProps.containsKey(HIVESITE_DIR)) {
      HiveJdbcConnector.addHiveSiteDirToClasspath(compactRunProps.getProperty(HIVESITE_DIR));
    }

    // Set and create the Hive JDBC connection
    if (compactRunProps.containsKey(HIVESERVER_CONNECTION_STRING)) {
      hiveJdbcConnector.withHiveConnectionFromUrl(compactRunProps.getProperty(HIVESERVER_CONNECTION_STRING));
    } else if (compactRunProps.containsKey(HIVESERVER_URL)) {
      hiveJdbcConnector.withHiveConnectionFromUrlUserPassword(compactRunProps.getProperty(HIVESERVER_URL),
          compactRunProps.getProperty(HIVESERVER_USER),
          PasswordManager.getInstance(compactRunProps).readPassword(compactRunProps.getProperty(HIVESERVER_PASSWORD)));
    } else {
      hiveJdbcConnector.withHiveEmbeddedConnection();
    }

    // Set Hive properties
    hiveJdbcConnector.setHiveProperties(compactRunProps);

    return hiveJdbcConnector;
  }
public static HiveJdbcConnector newConnectorWithProps ( Properties compactRunProps ) throws SQLException { boolean isSimulate = Boolean . valueOf ( compactRunProps . getProperty ( HIVE_EXECUTION_SIMULATE ) ) ; HiveJdbcConnector hiveJdbcConnector = new HiveJdbcConnector ( isSimulate ) ; hiveJdbcConnector . withHiveServerVersion ( Integer . parseInt ( compactRunProps . getProperty ( HIVESERVER_VERSION , DEFAULT_HIVESERVER_VERSION ) ) ) ; if ( compactRunProps . containsKey ( HIVESITE_DIR ) ) { HiveJdbcConnector . addHiveSiteDirToClasspath ( compactRunProps . getProperty ( HIVESITE_DIR ) ) ; } if ( compactRunProps . containsKey ( HIVESERVER_CONNECTION_STRING ) ) { hiveJdbcConnector . withHiveConnectionFromUrl ( compactRunProps . getProperty ( HIVESERVER_CONNECTION_STRING ) ) ; } else if ( compactRunProps . containsKey ( HIVESERVER_URL ) ) { hiveJdbcConnector . withHiveConnectionFromUrlUserPassword ( compactRunProps . getProperty ( HIVESERVER_URL ) , compactRunProps . getProperty ( HIVESERVER_USER ) , PasswordManager . getInstance ( compactRunProps ) . readPassword ( compactRunProps . getProperty ( HIVESERVER_PASSWORD ) ) ) ; } else { hiveJdbcConnector . withHiveEmbeddedConnection ( ) ; } hiveJdbcConnector . setHiveProperties ( compactRunProps ) ; return hiveJdbcConnector ; }
Create a new {@link HiveJdbcConnector} based on the configs in a {@link Properties} object
@param compactRunProps contains the configuration keys to construct the {@link HiveJdbcConnector}
@throws SQLException if there is a problem setting up the JDBC connection
@return