org.apache.hadoop.hive.ql.metadata
Class HiveUtils

java.lang.Object
  extended by org.apache.hadoop.hive.ql.metadata.HiveUtils

public final class HiveUtils
extends Object

General collection of helper functions.


Field Summary
static char COLON
           
static String LBRACE
           
static String LBRACKET
           
static String LINE_SEP
           
static char QUOTE
           
static String RBRACE
           
static String RBRACKET
           
 
Method Summary
static String escapeString(String str)
           
static org.apache.hadoop.io.Text escapeText(org.apache.hadoop.io.Text text)
           
static HiveAuthenticationProvider getAuthenticator(org.apache.hadoop.conf.Configuration conf, HiveConf.ConfVars authenticatorConfKey)
           
static HiveAuthorizationProvider getAuthorizeProviderManager(org.apache.hadoop.conf.Configuration conf, HiveConf.ConfVars authorizationProviderConfKey, HiveAuthenticationProvider authenticator)
           
static HiveAuthorizationProvider getAuthorizeProviderManager(org.apache.hadoop.conf.Configuration conf, HiveConf.ConfVars authorizationProviderConfKey, HiveAuthenticationProvider authenticator, boolean nullIfOtherClass)
          Create a new instance of HiveAuthorizationProvider
static HiveAuthorizerFactory getAuthorizerFactory(org.apache.hadoop.conf.Configuration conf, HiveConf.ConfVars authorizationProviderConfKey)
          Return HiveAuthorizerFactory used by new authorization plugin interface.
static HiveIndexHandler getIndexHandler(HiveConf conf, String indexHandlerClass)
           
static HiveStorageHandler getStorageHandler(org.apache.hadoop.conf.Configuration conf, String className)
           
static String getUnparsedColumnNamesFromFieldSchema(List<org.apache.hadoop.hive.metastore.api.FieldSchema> fieldSchemas)
          Convert FieldSchemas to columnNames with backticks around them.
static String lightEscapeString(String str)
           
static int unescapeText(org.apache.hadoop.io.Text text)
           
static String unparseIdentifier(String identifier)
          Regenerate an identifier as part of unparsing it back to SQL text.
static String unparseIdentifier(String identifier, org.apache.hadoop.conf.Configuration conf)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

QUOTE

public static final char QUOTE
See Also:
Constant Field Values

COLON

public static final char COLON
See Also:
Constant Field Values

LBRACKET

public static final String LBRACKET
See Also:
Constant Field Values

RBRACKET

public static final String RBRACKET
See Also:
Constant Field Values

LBRACE

public static final String LBRACE
See Also:
Constant Field Values

RBRACE

public static final String RBRACE
See Also:
Constant Field Values

LINE_SEP

public static final String LINE_SEP
Method Detail

escapeString

public static String escapeString(String str)

escapeText

public static org.apache.hadoop.io.Text escapeText(org.apache.hadoop.io.Text text)

unescapeText

public static int unescapeText(org.apache.hadoop.io.Text text)

lightEscapeString

public static String lightEscapeString(String str)

unparseIdentifier

public static String unparseIdentifier(String identifier)
Regenerate an identifier as part of unparsing it back to SQL text.


unparseIdentifier

public static String unparseIdentifier(String identifier,
                                       org.apache.hadoop.conf.Configuration conf)

getStorageHandler

public static HiveStorageHandler getStorageHandler(org.apache.hadoop.conf.Configuration conf,
                                                   String className)
                                            throws HiveException
Throws:
HiveException

getIndexHandler

public static HiveIndexHandler getIndexHandler(HiveConf conf,
                                               String indexHandlerClass)
                                        throws HiveException
Throws:
HiveException

getAuthorizeProviderManager

public static HiveAuthorizationProvider getAuthorizeProviderManager(org.apache.hadoop.conf.Configuration conf,
                                                                    HiveConf.ConfVars authorizationProviderConfKey,
                                                                    HiveAuthenticationProvider authenticator)
                                                             throws HiveException
Throws:
HiveException

getAuthorizeProviderManager

public static HiveAuthorizationProvider getAuthorizeProviderManager(org.apache.hadoop.conf.Configuration conf,
                                                                    HiveConf.ConfVars authorizationProviderConfKey,
                                                                    HiveAuthenticationProvider authenticator,
                                                                    boolean nullIfOtherClass)
                                                             throws HiveException
Create a new instance of HiveAuthorizationProvider

Parameters:
conf -
authorizationProviderConfKey -
authenticator -
nullIfOtherClass - - return null if configuration does not point to a HiveAuthorizationProvider subclass
Returns:
new instance of HiveAuthorizationProvider
Throws:
HiveException

getAuthorizerFactory

public static HiveAuthorizerFactory getAuthorizerFactory(org.apache.hadoop.conf.Configuration conf,
                                                         HiveConf.ConfVars authorizationProviderConfKey)
                                                  throws HiveException
Return HiveAuthorizerFactory used by new authorization plugin interface.

Parameters:
conf -
authorizationProviderConfKey -
Returns:
Throws:
HiveException - if HiveAuthorizerFactory specified in configuration could not

getAuthenticator

public static HiveAuthenticationProvider getAuthenticator(org.apache.hadoop.conf.Configuration conf,
                                                          HiveConf.ConfVars authenticatorConfKey)
                                                   throws HiveException
Throws:
HiveException

getUnparsedColumnNamesFromFieldSchema

public static String getUnparsedColumnNamesFromFieldSchema(List<org.apache.hadoop.hive.metastore.api.FieldSchema> fieldSchemas)
Convert FieldSchemas to columnNames with backticks around them.



Copyright © 2014 The Apache Software Foundation. All rights reserved.