public class Utils extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
HADOOP_CONFIGURATION_CLASS |
static String |
HADOOP_SECURITY_CREDENTIAL_PATH |
static String |
HIVE_SERVER2_RETRY_FALSE |
static String |
HIVE_SERVER2_RETRY_KEY |
static String |
HIVE_SERVER2_RETRY_TRUE |
static String |
KYUUBI_CLIENT_VERSION_KEY |
static Pattern |
KYUUBI_OPERATION_HINT_PATTERN |
static List<String> |
URL_PREFIX_LIST
The required prefix list for the connection URL.
|
| Constructor and Description |
|---|
Utils() |
| Modifier and Type | Method and Description |
|---|---|
static JdbcConnectionParams |
extractURLComponents(String uri,
Properties info)
This method handles the base parsing of the given jdbc uri.
|
static String |
getCanonicalHostName(String hostName)
Method to get canonical-ized hostname, given a hostname (possibly a CNAME).
|
static String |
getPassword(Map<String,String> confMap,
String key)
Method to get the password from the configuration map if available.
|
static String |
getVersion() |
static boolean |
isKyuubiOperationHint(String hint) |
static String |
parsePropertyFromUrl(String url,
String key) |
static JdbcConnectionParams |
parseURL(String uri) |
static JdbcConnectionParams |
parseURL(String uri,
Properties info)
Parse JDBC connection URL The new format of the URL is:
jdbc:hive2://
|
static String |
updateSql(String sql,
HashMap<Integer,String> parameters)
update the SQL string with parameters set by setXXX methods of
PreparedStatement |
public static final List<String> URL_PREFIX_LIST
public static final String HIVE_SERVER2_RETRY_KEY
public static final String HIVE_SERVER2_RETRY_TRUE
public static final String HIVE_SERVER2_RETRY_FALSE
public static final String HADOOP_CONFIGURATION_CLASS
public static final String HADOOP_SECURITY_CREDENTIAL_PATH
public static final Pattern KYUUBI_OPERATION_HINT_PATTERN
public static final String KYUUBI_CLIENT_VERSION_KEY
public static String updateSql(String sql, HashMap<Integer,String> parameters) throws SQLException
PreparedStatementSQLExceptionpublic static JdbcConnectionParams parseURL(String uri) throws JdbcUriParseException, SQLException, ZooKeeperHiveClientException
public static JdbcConnectionParams parseURL(String uri, Properties info) throws JdbcUriParseException, SQLException, ZooKeeperHiveClientException
As before, if the host/port is not specified, it the driver runs an embedded hive. examples - jdbc:hive2://ubuntu:11000/db2?hive.cli.conf.printheader=true;hive.exec.mode.local.auto.inputbytes.max=9999#stab=salesTable;icol=customerID jdbc:hive2://?hive.cli.conf.printheader=true;hive.exec.mode.local.auto.inputbytes.max=9999#stab=salesTable;icol=customerID jdbc:hive2://ubuntu:11000/db2;user=foo;password=bar
Connect to http://server:10001/hs2, with specified basicAuth credentials and initial database: jdbc:hive2://server:10001/db;user=foo;password=bar?hive.server2.transport.mode=http;hive.server2.thrift.http.path=hs2
public static JdbcConnectionParams extractURLComponents(String uri, Properties info) throws JdbcUriParseException
JdbcUriParseExceptionpublic static String getCanonicalHostName(String hostName)
hostName - The hostname to be canonical-ized.public static boolean isKyuubiOperationHint(String hint)
public static String getVersion()
public static String getPassword(Map<String,String> confMap, String key)
confMap - configuration mapkey - paramCopyright © 2023 The Apache Software Foundation. All rights reserved.