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

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< ColumnDefgetColumnDefs ()
 
List< ColumnDefgetPartitionColumnDefs ()
 
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< ColumnDefextractParquetSchema (HdfsUri location) throws AnalysisException
 

Private Attributes

final HdfsUri schemaLocation_
 
final THdfsFileFormat schemaFileFormat_
 

Detailed Description

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.

Constructor & Destructor Documentation

com.cloudera.impala.analysis.CreateTableLikeFileStmt.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 
)
inline

Member Function Documentation

void com.cloudera.impala.analysis.CreateTableLikeFileStmt.analyze ( Analyzer  analyzer) throws AnalysisException
inline
CreateTableStmt com.cloudera.impala.analysis.CreateTableStmt.clone ( )
inlineinherited
static Type com.cloudera.impala.analysis.CreateTableLikeFileStmt.convertLogicalParquetType ( parquet.schema.Type  parquetType) throws AnalysisException
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().

static Type com.cloudera.impala.analysis.CreateTableLikeFileStmt.convertPrimitiveParquetType ( parquet.schema.Type  parquetType) throws AnalysisException
inlinestaticprivate
static List<ColumnDef> com.cloudera.impala.analysis.CreateTableLikeFileStmt.extractParquetSchema ( HdfsUri  location) throws AnalysisException
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().

String com.cloudera.impala.analysis.CreateTableStmt.getComment ( )
inlineinherited
String com.cloudera.impala.analysis.CreateTableStmt.getDb ( )
inlineinherited
String com.cloudera.impala.analysis.CreateTableStmt.getOwner ( )
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().

List<ColumnDef> com.cloudera.impala.analysis.CreateTableStmt.getPartitionColumnDefs ( )
inlineinherited
RowFormat com.cloudera.impala.analysis.CreateTableStmt.getRowFormat ( )
inlineinherited
Map<String, String> com.cloudera.impala.analysis.CreateTableStmt.getSerdeProperties ( )
inlineinherited
TableName com.cloudera.impala.analysis.CreateTableStmt.getTblName ( )
inlineinherited
Map<String, String> com.cloudera.impala.analysis.CreateTableStmt.getTblProperties ( )
inlineinherited
boolean com.cloudera.impala.analysis.StatementBase.isExplain ( )
inlineinherited
static parquet.schema.MessageType com.cloudera.impala.analysis.CreateTableLikeFileStmt.loadParquetSchema ( Path  pathToFile) throws AnalysisException
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().

void com.cloudera.impala.analysis.StatementBase.setIsExplain ( )
inlineinherited
void com.cloudera.impala.analysis.CreateTableStmt.setLocation ( HdfsUri  location)
inlineinherited

Definition at line 136 of file CreateTableStmt.java.

static void com.cloudera.impala.analysis.CreateTableStmt.unescapeProperties ( Map< String, String >  propertyMap)
inlinestaticinherited

Unescapes all values in the property map.

Definition at line 361 of file CreateTableStmt.java.

Referenced by com.cloudera.impala.analysis.CreateTableStmt.CreateTableStmt().

Member Data Documentation

final THdfsFileFormat com.cloudera.impala.analysis.CreateTableLikeFileStmt.schemaFileFormat_
private
final HdfsUri com.cloudera.impala.analysis.CreateTableLikeFileStmt.schemaLocation_
private

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