org.apache.hive.jdbc
Class Utils

java.lang.Object
  extended by org.apache.hive.jdbc.Utils

public class Utils
extends Object


Nested Class Summary
static class Utils.JdbcConnectionParams
           
 
Field Summary
static String DEFAULT_DATABASE
          Hive's default database name
static String DEFAULT_PORT
          If host is provided, without a port.
static String URL_PREFIX
          The required prefix for the connection URL.
 
Constructor Summary
Utils()
           
 
Method Summary
static int hiveTypeToSqlType(String type)
          Convert hive types to sql types.
static Utils.JdbcConnectionParams parseURL(String uri)
          Parse JDBC connection URL The new format of the URL is jdbc:hive://:/dbName;sess_var_list?hive_conf_list#hive_var_list where the optional sess, conf and var lists are semicolon separated = pairs.
static void verifySuccess(TStatus status)
           
static void verifySuccess(TStatus status, boolean withInfo)
           
static void verifySuccessWithInfo(TStatus status)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

URL_PREFIX

public static final String URL_PREFIX
The required prefix for the connection URL.

See Also:
Constant Field Values

DEFAULT_PORT

public static final String DEFAULT_PORT
If host is provided, without a port.

See Also:
Constant Field Values

DEFAULT_DATABASE

public static final String DEFAULT_DATABASE
Hive's default database name

See Also:
Constant Field Values
Constructor Detail

Utils

public Utils()
Method Detail

hiveTypeToSqlType

public static int hiveTypeToSqlType(String type)
                             throws SQLException
Convert hive types to sql types.

Parameters:
type -
Returns:
Integer java.sql.Types values
Throws:
SQLException

verifySuccessWithInfo

public static void verifySuccessWithInfo(TStatus status)
                                  throws SQLException
Throws:
SQLException

verifySuccess

public static void verifySuccess(TStatus status)
                          throws SQLException
Throws:
SQLException

verifySuccess

public static void verifySuccess(TStatus status,
                                 boolean withInfo)
                          throws SQLException
Throws:
SQLException

parseURL

public static Utils.JdbcConnectionParams parseURL(String uri)
                                           throws IllegalArgumentException
Parse JDBC connection URL The new format of the URL is jdbc:hive://:/dbName;sess_var_list?hive_conf_list#hive_var_list where the optional sess, conf and var lists are semicolon separated = pairs. As before, if the host/port is not specified, it the driver runs an embedded hive. examples - jdbc:hive://ubuntu:11000/db2?hive.cli.conf.printheader=true;hive.exec.mode.local.auto.inputbytes.max=9999#stab=salesTable;icol=customerID jdbc:hive://?hive.cli.conf.printheader=true;hive.exec.mode.local.auto.inputbytes.max=9999#stab=salesTable;icol=customerID jdbc:hive://ubuntu:11000/db2;user=foo;password=bar Note that currently the session properties are not used.

Parameters:
uri -
Returns:
Throws:
IllegalArgumentException


Copyright © 2013 The Apache Software Foundation