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

Public Member Functions

 CreateTableStmt (TableName tableName, List< ColumnDef > columnDefs, List< ColumnDef > partitionColumnDefs, boolean isExternal, String comment, RowFormat rowFormat, THdfsFileFormat fileFormat, HdfsUri location, HdfsCachingOp cachingOp, boolean ifNotExists, Map< String, String > tblProperties, Map< String, String > serdeProperties)
 
 CreateTableStmt (CreateTableStmt other)
 
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 ()
 
String toSql ()
 
TCreateTableParams toThrift ()
 
void analyze (Analyzer analyzer) throws AnalysisException
 
void setIsExplain ()
 
boolean isExplain ()
 

Static Public Member Functions

static void unescapeProperties (Map< String, String > propertyMap)
 

Protected Attributes

boolean isExplain_ = false
 

Private Member Functions

void analyzeColumnDefs (Analyzer analyzer) throws AnalysisException
 
List< ColumnDefanalyzeAvroSchema (Analyzer analyzer) throws AnalysisException
 
void analyzeRowFormatValue (String value) throws AnalysisException
 

Private Attributes

final ArrayList< ColumnDefcolumnDefs_
 
final String comment_
 
final boolean isExternal_
 
final boolean ifNotExists_
 
final THdfsFileFormat fileFormat_
 
final ArrayList< ColumnDefpartitionColDefs_
 
final RowFormat rowFormat_
 
final TableName tableName_
 
final Map< String, String > tblProperties_
 
final Map< String, String > serdeProperties_
 
final HdfsCachingOp cachingOp_
 
HdfsUri location_
 
String dbName_
 
String owner_
 

Detailed Description

Represents a CREATE TABLE statement.

Definition at line 45 of file CreateTableStmt.java.

Constructor & Destructor Documentation

com.cloudera.impala.analysis.CreateTableStmt.CreateTableStmt ( TableName  tableName,
List< ColumnDef columnDefs,
List< ColumnDef partitionColumnDefs,
boolean  isExternal,
String  comment,
RowFormat  rowFormat,
THdfsFileFormat  fileFormat,
HdfsUri  location,
HdfsCachingOp  cachingOp,
boolean  ifNotExists,
Map< String, String >  tblProperties,
Map< String, String >  serdeProperties 
)
inline

Builds a CREATE TABLE statement

Parameters
tableName- Name of the new table
columnDefs- List of column definitions for the table
partitionColumnDefs- List of partition column definitions for the table
isExternal- If true, the table's data will be preserved if dropped.
comment- Comment to attach to the table
rowFormat- Custom row format of the table. Use RowFormat.DEFAULT_ROW_FORMAT to specify default row format.
fileFormat- File format of the table
location- The HDFS location of where the table data will stored.
cachingOp- The HDFS caching op that should be applied to this table.
ifNotExists- If true, no errors are thrown if the table already exists.
tblProperties- Optional map of key/values to persist with table metadata.
serdeProperties- Optional map of key/values to persist with table serde metadata.

Definition at line 80 of file CreateTableStmt.java.

References com.cloudera.impala.analysis.CreateTableStmt.isExternal(), com.cloudera.impala.analysis.CreateTableStmt.serdeProperties_, com.cloudera.impala.analysis.CreateTableStmt.tblProperties_, and com.cloudera.impala.analysis.CreateTableStmt.unescapeProperties().

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

Member Function Documentation

void com.cloudera.impala.analysis.CreateTableStmt.analyze ( Analyzer  analyzer) throws AnalysisException
inline
List<ColumnDef> com.cloudera.impala.analysis.CreateTableStmt.analyzeAvroSchema ( Analyzer  analyzer) throws AnalysisException
inlineprivate
void com.cloudera.impala.analysis.CreateTableStmt.analyzeColumnDefs ( Analyzer  analyzer) throws AnalysisException
inlineprivate

Analyzes columnDefs_ and partitionColDefs_ checking whether all column names are unique.

Definition at line 237 of file CreateTableStmt.java.

References com.cloudera.impala.analysis.CreateTableStmt.columnDefs_, and com.cloudera.impala.analysis.CreateTableStmt.partitionColDefs_.

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

void com.cloudera.impala.analysis.CreateTableStmt.analyzeRowFormatValue ( String  value) throws AnalysisException
inlineprivate
CreateTableStmt com.cloudera.impala.analysis.CreateTableStmt.clone ( )
inline
String com.cloudera.impala.analysis.CreateTableStmt.getComment ( )
inline
String com.cloudera.impala.analysis.CreateTableStmt.getDb ( )
inline
String com.cloudera.impala.analysis.CreateTableStmt.getOwner ( )
inline

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 ( )
inline
RowFormat com.cloudera.impala.analysis.CreateTableStmt.getRowFormat ( )
inline
Map<String, String> com.cloudera.impala.analysis.CreateTableStmt.getSerdeProperties ( )
inline
TableName com.cloudera.impala.analysis.CreateTableStmt.getTblName ( )
inline
Map<String, String> com.cloudera.impala.analysis.CreateTableStmt.getTblProperties ( )
inline
boolean com.cloudera.impala.analysis.StatementBase.isExplain ( )
inlineinherited
void com.cloudera.impala.analysis.StatementBase.setIsExplain ( )
inlineinherited
void com.cloudera.impala.analysis.CreateTableStmt.setLocation ( HdfsUri  location)
inline

Definition at line 136 of file CreateTableStmt.java.

String com.cloudera.impala.analysis.CreateTableStmt.toSql ( )
inline
Returns
SQL syntax corresponding to this node.

Implements com.cloudera.impala.analysis.ParseNode.

Definition at line 161 of file CreateTableStmt.java.

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

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

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 boolean com.cloudera.impala.analysis.CreateTableStmt.ifNotExists_
private
final boolean com.cloudera.impala.analysis.CreateTableStmt.isExternal_
private
String com.cloudera.impala.analysis.CreateTableStmt.owner_
private

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