Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
|
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 |
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.
|
inlinestaticprivate |
Definition at line 243 of file ToSqlUtils.java.
References com.cloudera.impala.catalog.Column.getComment(), com.cloudera.impala.catalog.Column.getName(), and com.cloudera.impala.catalog.Column.getType().
Referenced by com.cloudera.impala.analysis.ToSqlUtils.getCreateTableSql().
|
inlinestatic |
Returns the "CREATE TABLE" SQL string corresponding to the given CreateTableStmt. statement.
Definition at line 109 of file ToSqlUtils.java.
References com.cloudera.impala.catalog.HdfsFileFormat.fromThrift(), com.cloudera.impala.analysis.CreateTableStmt.getColumnDefs(), com.cloudera.impala.analysis.CreateTableStmt.getComment(), com.cloudera.impala.analysis.CreateTableStmt.getDb(), com.cloudera.impala.analysis.CreateTableStmt.getFileFormat(), com.cloudera.impala.analysis.CreateTableStmt.getIfNotExists(), com.cloudera.impala.analysis.CreateTableStmt.getLocation(), com.cloudera.impala.analysis.CreateTableStmt.getPartitionColumnDefs(), com.cloudera.impala.analysis.CreateTableStmt.getSerdeProperties(), and com.cloudera.impala.catalog.HdfsCompression.NONE.
Referenced by com.cloudera.impala.analysis.ToSqlUtils.getCreateTableSql().
|
inlinestatic |
Returns a "CREATE TABLE" statement that creates the specified table.
Definition at line 129 of file ToSqlUtils.java.
References com.cloudera.impala.analysis.ToSqlUtils.columnToSql(), com.cloudera.impala.analysis.ToSqlUtils.getCreateTableSql(), and com.cloudera.impala.analysis.ToSqlUtils.HIDDEN_TABLE_PROPERTIES.
|
inlinestatic |
Returns a "CREATE TABLE" string that creates the table with the specified properties. The tableName must not be null. If columnsSql is null, the schema syntax will not be generated.
Definition at line 166 of file ToSqlUtils.java.
References com.cloudera.impala.catalog.RowFormat.getEscapeChar(), com.cloudera.impala.catalog.RowFormat.getFieldDelimiter(), com.cloudera.impala.catalog.RowFormat.getLineDelimiter(), com.cloudera.impala.catalog.RowFormat.isDefault(), com.cloudera.impala.catalog.HdfsCompression.LZO, com.cloudera.impala.catalog.HdfsCompression.LZO_INDEX, and com.cloudera.impala.analysis.ToSqlUtils.propertyMapToSql().
|
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().
|
inlinestatic |
Definition at line 96 of file ToSqlUtils.java.
References com.cloudera.impala.analysis.ToSqlUtils.getIdentSql().
|
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.
|
inlinestaticprivate |
Definition at line 252 of file ToSqlUtils.java.
Referenced by com.cloudera.impala.analysis.ToSqlUtils.getCreateTableSql().
|
staticprivate |
Definition at line 50 of file ToSqlUtils.java.
Referenced by com.cloudera.impala.analysis.ToSqlUtils.getCreateTableSql().