Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
com.cloudera.impala.analysis.ToSqlUtils Class Reference
Collaboration diagram for com.cloudera.impala.analysis.ToSqlUtils:

Static Public Member Functions

static String getIdentSql (String ident)
 
static String getPathSql (List< String > path)
 
static String getCreateTableSql (CreateTableStmt stmt)
 
static String getCreateTableSql (Table table) throws CatalogException
 
static String getCreateTableSql (String dbName, String tableName, String tableComment, List< String > columnsSql, List< String > partitionColumnsSql, Map< String, String > tblProperties, Map< String, String > serdeParameters, boolean isExternal, boolean ifNotExists, RowFormat rowFormat, HdfsFileFormat fileFormat, HdfsCompression compression, String storageHandlerClass, String location)
 
static String getPlanHintsSql (List< String > hints)
 

Static Private Member Functions

static String columnToSql (Column col)
 
static String propertyMapToSql (Map< String, String > propertyMap)
 

Static Private Attributes

static final ImmutableSet< String > HIDDEN_TABLE_PROPERTIES
 

Detailed Description

Contains utility methods for creating SQL strings, for example, for creating identifier strings that are compatible with Hive or Impala.

Definition at line 46 of file ToSqlUtils.java.

Member Function Documentation

static String com.cloudera.impala.analysis.ToSqlUtils.columnToSql ( Column  col)
inlinestaticprivate
static String com.cloudera.impala.analysis.ToSqlUtils.getCreateTableSql ( Table  table) throws CatalogException
inlinestatic
static String com.cloudera.impala.analysis.ToSqlUtils.getCreateTableSql ( String  dbName,
String  tableName,
String  tableComment,
List< String >  columnsSql,
List< String >  partitionColumnsSql,
Map< String, String >  tblProperties,
Map< String, String >  serdeParameters,
boolean  isExternal,
boolean  ifNotExists,
RowFormat  rowFormat,
HdfsFileFormat  fileFormat,
HdfsCompression  compression,
String  storageHandlerClass,
String  location 
)
inlinestatic
static String com.cloudera.impala.analysis.ToSqlUtils.getIdentSql ( String  ident)
inlinestatic

Given an unquoted identifier string, returns an identifier lexable by Impala and Hive, possibly by enclosing the original identifier in "`" quotes. For example, Hive cannot parse its own auto-generated column names "_c0", "_c1" etc. unless they are quoted. Impala and Hive keywords must also be quoted.

Impala's lexer recognizes a superset of the unquoted identifiers that Hive can. At the same time, Impala's and Hive's list of keywords differ. This method always returns an identifier that Impala and Hive can recognize, although for some identifiers the quotes may not be strictly necessary for one or the other system.

Definition at line 66 of file ToSqlUtils.java.

Referenced by com.cloudera.impala.analysis.ToSqlUtils.getPathSql(), and com.cloudera.impala.analysis.TableName.toSql().

static String com.cloudera.impala.analysis.ToSqlUtils.getPathSql ( List< String >  path)
inlinestatic
static String com.cloudera.impala.analysis.ToSqlUtils.getPlanHintsSql ( List< String >  hints)
inlinestatic

Returns a SQL representation of the given list of hints. Uses the end-of-line commented plan hint style such that hinted views created by Impala are readable by Hive (parsed as a comment by Hive).

Definition at line 270 of file ToSqlUtils.java.

static String com.cloudera.impala.analysis.ToSqlUtils.propertyMapToSql ( Map< String, String >  propertyMap)
inlinestaticprivate

Member Data Documentation

final ImmutableSet<String> com.cloudera.impala.analysis.ToSqlUtils.HIDDEN_TABLE_PROPERTIES
staticprivate
Initial value:
=
ImmutableSet.of("EXTERNAL", "comment")

Definition at line 50 of file ToSqlUtils.java.

Referenced by com.cloudera.impala.analysis.ToSqlUtils.getCreateTableSql().


The documentation for this class was generated from the following file: