Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
|
Public Member Functions | |
CreateTableLikeFileStmt (TableName tableName, THdfsFileFormat schemaFileFormat, HdfsUri schemaLocation, List< ColumnDef > partitionColumnDescs, boolean isExternal, String comment, RowFormat rowFormat, THdfsFileFormat fileFormat, HdfsUri location, HdfsCachingOp cachingOp, boolean ifNotExists, Map< String, String > tblProperties, Map< String, String > serdeProperties) | |
String | toSql () |
void | analyze (Analyzer analyzer) throws AnalysisException |
CreateTableStmt | clone () |
String | getTbl () |
TableName | getTblName () |
List< ColumnDef > | getColumnDefs () |
List< ColumnDef > | getPartitionColumnDefs () |
String | getComment () |
boolean | isExternal () |
boolean | getIfNotExists () |
HdfsUri | getLocation () |
void | setLocation (HdfsUri location) |
THdfsFileFormat | getFileFormat () |
RowFormat | getRowFormat () |
Map< String, String > | getTblProperties () |
Map< String, String > | getSerdeProperties () |
String | getOwner () |
String | getDb () |
TCreateTableParams | toThrift () |
void | setIsExplain () |
boolean | isExplain () |
Static Public Member Functions | |
static void | unescapeProperties (Map< String, String > propertyMap) |
Protected Attributes | |
boolean | isExplain_ = false |
Static Private Member Functions | |
static parquet.schema.MessageType | loadParquetSchema (Path pathToFile) throws AnalysisException |
static Type | convertPrimitiveParquetType (parquet.schema.Type parquetType) throws AnalysisException |
static Type | convertLogicalParquetType (parquet.schema.Type parquetType) throws AnalysisException |
static List< ColumnDef > | extractParquetSchema (HdfsUri location) throws AnalysisException |
Private Attributes | |
final HdfsUri | schemaLocation_ |
final THdfsFileFormat | schemaFileFormat_ |
Represents a CREATE TABLE tablename LIKE fileformat '/path/to/file' statement where the schema is inferred from the given file. Does not partition the table by default.
Definition at line 50 of file CreateTableLikeFileStmt.java.
|
inline |
Definition at line 54 of file CreateTableLikeFileStmt.java.
References com.cloudera.impala.analysis.CreateTableLikeFileStmt.schemaFileFormat_, and com.cloudera.impala.analysis.CreateTableLikeFileStmt.schemaLocation_.
|
inline |
Perform semantic analysis of node and all of its children. Throws exception if any errors found.
analyzer |
AnalysisException |
Implements com.cloudera.impala.analysis.ParseNode.
Definition at line 213 of file CreateTableLikeFileStmt.java.
References com.cloudera.impala.authorization.Privilege.ALL, com.cloudera.impala.analysis.CreateTableLikeFileStmt.extractParquetSchema(), com.cloudera.impala.analysis.CreateTableStmt.getColumnDefs(), com.cloudera.impala.analysis.CreateTableLikeFileStmt.schemaFileFormat_, and com.cloudera.impala.analysis.CreateTableLikeFileStmt.schemaLocation_.
|
inlineinherited |
Definition at line 126 of file CreateTableStmt.java.
References com.cloudera.impala.analysis.CreateTableStmt.CreateTableStmt().
|
inlinestaticprivate |
Converts a "logical" parquet type to an Impala column type. A logical type is a primitive type with an annotation. The annotations are stored as a "OriginalType". The parquet documentation refers to these as logical types, so we use that terminology here.
Definition at line 144 of file CreateTableLikeFileStmt.java.
References com.cloudera.impala.catalog.Type.STRING.
Referenced by com.cloudera.impala.analysis.CreateTableLikeFileStmt.extractParquetSchema().
|
inlinestaticprivate |
Converts a "primitive" parquet type to an Impala column type. A primitive type is a non-nested type which does not have annotations.
Definition at line 108 of file CreateTableLikeFileStmt.java.
References com.cloudera.impala.catalog.Type.BIGINT, com.cloudera.impala.catalog.Type.BOOLEAN, com.cloudera.impala.catalog.Type.DOUBLE, com.cloudera.impala.catalog.Type.FLOAT, com.cloudera.impala.catalog.Type.INT, com.cloudera.impala.catalog.Type.STRING, and com.cloudera.impala.catalog.Type.TIMESTAMP.
Referenced by com.cloudera.impala.analysis.CreateTableLikeFileStmt.extractParquetSchema().
|
inlinestaticprivate |
Parses a parquet file stored in HDFS and returns the corresponding Impala schema. This fails with an analysis exception if any errors occur reading the file, parsing the parquet schema, or if the parquet types cannot be represented in Impala.
Definition at line 171 of file CreateTableLikeFileStmt.java.
References com.cloudera.impala.analysis.CreateTableLikeFileStmt.convertLogicalParquetType(), com.cloudera.impala.analysis.CreateTableLikeFileStmt.convertPrimitiveParquetType(), com.cloudera.impala.analysis.CreateTableLikeFileStmt.loadParquetSchema(), and com.cloudera.impala.analysis.TypeDef.toString().
Referenced by com.cloudera.impala.analysis.CreateTableLikeFileStmt.analyze().
|
inlineinherited |
Definition at line 130 of file CreateTableStmt.java.
References com.cloudera.impala.analysis.CreateTableStmt.columnDefs_.
Referenced by com.cloudera.impala.analysis.CreateTableDataSrcStmt.analyze(), com.cloudera.impala.analysis.CreateTableLikeFileStmt.analyze(), com.cloudera.impala.analysis.ToSqlUtils.getCreateTableSql(), com.cloudera.impala.catalog.Type.parseColumnType(), and com.cloudera.impala.analysis.CreateTableStmt.toThrift().
|
inlineinherited |
Definition at line 132 of file CreateTableStmt.java.
References com.cloudera.impala.analysis.CreateTableStmt.comment_.
Referenced by com.cloudera.impala.analysis.ToSqlUtils.getCreateTableSql(), and com.cloudera.impala.analysis.CreateTableLikeFileStmt.toSql().
|
inlineinherited |
Can only be called after analysis, returns the name of the database the table will be created within.
Definition at line 155 of file CreateTableStmt.java.
References com.cloudera.impala.analysis.CreateTableStmt.dbName_.
Referenced by com.cloudera.impala.analysis.CreateTableAsSelectStmt.analyze(), com.cloudera.impala.analysis.ToSqlUtils.getCreateTableSql(), com.cloudera.impala.analysis.CreateTableLikeFileStmt.toSql(), and com.cloudera.impala.analysis.CreateTableStmt.toThrift().
|
inlineinherited |
Definition at line 137 of file CreateTableStmt.java.
References com.cloudera.impala.analysis.CreateTableStmt.fileFormat_.
Referenced by com.cloudera.impala.analysis.CreateTableAsSelectStmt.analyze(), com.cloudera.impala.analysis.ToSqlUtils.getCreateTableSql(), and com.cloudera.impala.analysis.CreateTableLikeFileStmt.toSql().
|
inlineinherited |
Definition at line 134 of file CreateTableStmt.java.
References com.cloudera.impala.analysis.CreateTableStmt.ifNotExists_.
Referenced by com.cloudera.impala.analysis.ToSqlUtils.getCreateTableSql(), com.cloudera.impala.analysis.CreateTableLikeFileStmt.toSql(), and com.cloudera.impala.analysis.CreateTableStmt.toThrift().
|
inlineinherited |
Definition at line 135 of file CreateTableStmt.java.
References com.cloudera.impala.analysis.CreateTableStmt.location_.
Referenced by com.cloudera.impala.analysis.CreateTableAsSelectStmt.analyze(), com.cloudera.impala.analysis.ToSqlUtils.getCreateTableSql(), and com.cloudera.impala.analysis.CreateTableLikeFileStmt.toSql().
|
inlineinherited |
Can only be called after analysis, returns the owner of this table (the user from the current session).
Definition at line 146 of file CreateTableStmt.java.
References com.cloudera.impala.analysis.CreateTableStmt.owner_.
Referenced by com.cloudera.impala.analysis.CreateTableStmt.toThrift().
|
inlineinherited |
Definition at line 131 of file CreateTableStmt.java.
References com.cloudera.impala.analysis.CreateTableStmt.partitionColDefs_.
Referenced by com.cloudera.impala.analysis.ToSqlUtils.getCreateTableSql(), and com.cloudera.impala.analysis.CreateTableStmt.toThrift().
|
inlineinherited |
Definition at line 138 of file CreateTableStmt.java.
References com.cloudera.impala.analysis.CreateTableStmt.rowFormat_.
Referenced by com.cloudera.impala.analysis.CreateTableLikeFileStmt.toSql().
|
inlineinherited |
Definition at line 140 of file CreateTableStmt.java.
References com.cloudera.impala.analysis.CreateTableStmt.serdeProperties_.
Referenced by com.cloudera.impala.analysis.ToSqlUtils.getCreateTableSql(), and com.cloudera.impala.analysis.CreateTableLikeFileStmt.toSql().
|
inlineinherited |
Definition at line 128 of file CreateTableStmt.java.
Referenced by com.cloudera.impala.analysis.AnalyzerTest.addTestTable(), com.cloudera.impala.analysis.CreateTableStmt.analyze(), com.cloudera.impala.analysis.CreateTableLikeFileStmt.toSql(), and com.cloudera.impala.analysis.CreateTableStmt.toThrift().
|
inlineinherited |
Definition at line 129 of file CreateTableStmt.java.
References com.cloudera.impala.analysis.CreateTableStmt.tableName_.
Referenced by com.cloudera.impala.analysis.CreateTableAsSelectStmt.CreateTableAsSelectStmt().
|
inlineinherited |
Definition at line 139 of file CreateTableStmt.java.
References com.cloudera.impala.analysis.CreateTableStmt.tblProperties_.
Referenced by com.cloudera.impala.analysis.CreateTableDataSrcStmt.analyze(), and com.cloudera.impala.analysis.CreateTableLikeFileStmt.toSql().
|
inlineinherited |
Definition at line 43 of file StatementBase.java.
References com.cloudera.impala.analysis.StatementBase.isExplain_.
|
inlineinherited |
Definition at line 133 of file CreateTableStmt.java.
References com.cloudera.impala.analysis.CreateTableStmt.isExternal_.
Referenced by com.cloudera.impala.analysis.CreateTableStmt.CreateTableStmt(), com.cloudera.impala.analysis.CreateTableLikeFileStmt.toSql(), and com.cloudera.impala.analysis.CreateTableStmt.toThrift().
|
inlinestaticprivate |
Reads the first block from the given HDFS file and returns the Parquet schema. Throws Analysis exception for any failure, such as failing to read the file or failing to parse the contents.
Definition at line 72 of file CreateTableLikeFileStmt.java.
Referenced by com.cloudera.impala.analysis.CreateTableLikeFileStmt.extractParquetSchema().
|
inlineinherited |
Definition at line 42 of file StatementBase.java.
References com.cloudera.impala.analysis.StatementBase.isExplain_.
|
inlineinherited |
Definition at line 136 of file CreateTableStmt.java.
|
inline |
Implements com.cloudera.impala.analysis.ParseNode.
Definition at line 197 of file CreateTableLikeFileStmt.java.
References 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.getRowFormat(), com.cloudera.impala.analysis.CreateTableStmt.getSerdeProperties(), com.cloudera.impala.analysis.CreateTableStmt.getTbl(), com.cloudera.impala.analysis.CreateTableStmt.getTblProperties(), com.cloudera.impala.analysis.CreateTableStmt.isExternal(), and com.cloudera.impala.analysis.CreateTableLikeFileStmt.schemaFileFormat_.
|
inlineinherited |
Definition at line 165 of file CreateTableStmt.java.
References com.cloudera.impala.analysis.CreateTableStmt.cachingOp_, com.cloudera.impala.analysis.CreateTableStmt.comment_, com.cloudera.impala.analysis.CreateTableStmt.fileFormat_, com.cloudera.impala.analysis.CreateTableStmt.getColumnDefs(), com.cloudera.impala.analysis.CreateTableStmt.getDb(), com.cloudera.impala.analysis.CreateTableStmt.getIfNotExists(), com.cloudera.impala.analysis.CreateTableStmt.getOwner(), com.cloudera.impala.analysis.CreateTableStmt.getPartitionColumnDefs(), com.cloudera.impala.analysis.CreateTableStmt.getTbl(), com.cloudera.impala.analysis.CreateTableStmt.isExternal(), com.cloudera.impala.analysis.CreateTableStmt.location_, com.cloudera.impala.analysis.CreateTableStmt.serdeProperties_, and com.cloudera.impala.analysis.CreateTableStmt.tblProperties_.
|
inlinestaticinherited |
Unescapes all values in the property map.
Definition at line 361 of file CreateTableStmt.java.
Referenced by com.cloudera.impala.analysis.CreateTableStmt.CreateTableStmt().
|
protectedinherited |
|
private |
|
private |
Definition at line 51 of file CreateTableLikeFileStmt.java.
Referenced by com.cloudera.impala.analysis.CreateTableLikeFileStmt.analyze(), and com.cloudera.impala.analysis.CreateTableLikeFileStmt.CreateTableLikeFileStmt().