Impala
Impalaistheopensource,nativeanalyticdatabaseforApacheHadoop.
|
Public Member Functions | |
InsertStmt (WithClause withClause, TableName targetTable, boolean overwrite, List< PartitionKeyValue > partitionKeyValues, List< String > planHints, QueryStmt queryStmt, List< String > columnPermutation) | |
InsertStmt (InsertStmt other) | |
InsertStmt | clone () |
void | analyze (Analyzer analyzer) throws AnalysisException |
List< String > | getPlanHints () |
TableName | getTargetTableName () |
Table | getTargetTable () |
void | setTargetTable (Table table) |
boolean | isOverwrite () |
QueryStmt | getQueryStmt () |
void | setQueryStmt (QueryStmt stmt) |
List< Expr > | getPartitionKeyExprs () |
Boolean | isRepartition () |
ArrayList< Expr > | getResultExprs () |
DataSink | createDataSink () |
String | toSql () |
void | setIsExplain () |
boolean | isExplain () |
Protected Attributes | |
boolean | isExplain_ = false |
Private Member Functions | |
void | setTargetTable (Analyzer analyzer) throws AnalysisException |
void | checkColumnCoverage (ArrayList< Column > selectExprTargetColumns, Set< String > mentionedColumnNames, int numSelectListExprs, int numStaticPartitionExprs) throws AnalysisException |
void | prepareExpressions (List< Column > selectExprTargetColumns, List< Expr > selectListExprs, Table tbl, Analyzer analyzer) throws AnalysisException |
Expr | checkTypeCompatibility (Column column, Expr expr) throws AnalysisException |
void | analyzePlanHints (Analyzer analyzer) throws AnalysisException |
Private Attributes | |
final WithClause | withClause_ |
final TableName | originalTableName_ |
TableName | targetTableName_ |
final boolean | overwrite_ |
final List< PartitionKeyValue > | partitionKeyValues_ |
final List< String > | planHints_ |
QueryStmt | queryStmt_ |
final boolean | needsGeneratedQueryStatement_ |
Table | table_ |
final List< Expr > | partitionKeyExprs_ = new ArrayList<Expr>() |
Boolean | isRepartition_ = null |
final ArrayList< Expr > | resultExprs_ = new ArrayList<Expr>() |
final List< String > | columnPermutation_ |
Static Private Attributes | |
static final Logger | LOG = LoggerFactory.getLogger(InsertStmt.class) |
Representation of a single insert statement, including the select statement whose results are to be inserted.
Definition at line 46 of file InsertStmt.java.
|
inline |
Definition at line 113 of file InsertStmt.java.
References com.cloudera.impala.analysis.InsertStmt.columnPermutation_, com.cloudera.impala.analysis.InsertStmt.needsGeneratedQueryStatement_, com.cloudera.impala.analysis.InsertStmt.originalTableName_, com.cloudera.impala.analysis.InsertStmt.overwrite_, com.cloudera.impala.analysis.InsertStmt.partitionKeyValues_, com.cloudera.impala.analysis.InsertStmt.planHints_, com.cloudera.impala.analysis.InsertStmt.queryStmt_, com.cloudera.impala.analysis.InsertStmt.table_, com.cloudera.impala.analysis.InsertStmt.targetTableName_, and com.cloudera.impala.analysis.InsertStmt.withClause_.
Referenced by com.cloudera.impala.analysis.InsertStmt.clone().
|
inline |
C'tor used in clone().
Definition at line 131 of file InsertStmt.java.
References com.cloudera.impala.analysis.InsertStmt.columnPermutation_, com.cloudera.impala.analysis.InsertStmt.needsGeneratedQueryStatement_, com.cloudera.impala.analysis.InsertStmt.originalTableName_, com.cloudera.impala.analysis.InsertStmt.overwrite_, com.cloudera.impala.analysis.InsertStmt.partitionKeyValues_, com.cloudera.impala.analysis.InsertStmt.planHints_, com.cloudera.impala.analysis.InsertStmt.queryStmt_, com.cloudera.impala.analysis.InsertStmt.table_, com.cloudera.impala.analysis.InsertStmt.targetTableName_, and com.cloudera.impala.analysis.InsertStmt.withClause_.
|
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 148 of file InsertStmt.java.
References com.cloudera.impala.analysis.InsertStmt.analyzePlanHints(), com.cloudera.impala.analysis.InsertStmt.checkColumnCoverage(), com.cloudera.impala.analysis.InsertStmt.columnPermutation_, com.cloudera.impala.catalog.Column.getPosition(), com.cloudera.impala.analysis.StatementBase.isExplain_, com.cloudera.impala.analysis.InsertStmt.needsGeneratedQueryStatement_, com.cloudera.impala.analysis.InsertStmt.partitionKeyValues_, com.cloudera.impala.analysis.InsertStmt.prepareExpressions(), com.cloudera.impala.analysis.InsertStmt.queryStmt_, com.cloudera.impala.analysis.InsertStmt.setTargetTable(), com.cloudera.impala.analysis.InsertStmt.table_, and com.cloudera.impala.analysis.InsertStmt.withClause_.
|
inlineprivate |
Definition at line 592 of file InsertStmt.java.
References com.cloudera.impala.analysis.InsertStmt.isRepartition_, com.cloudera.impala.analysis.InsertStmt.partitionKeyValues_, com.cloudera.impala.analysis.InsertStmt.planHints_, and com.cloudera.impala.analysis.InsertStmt.table_.
Referenced by com.cloudera.impala.analysis.InsertStmt.analyze().
|
inlineprivate |
Checks that the column permutation + select list + static partition exprs + dynamic partition exprs collectively cover exactly all columns in the target table (not more of fewer).
Definition at line 387 of file InsertStmt.java.
References com.cloudera.impala.analysis.InsertStmt.columnPermutation_, com.cloudera.impala.catalog.Table.getColumns(), com.cloudera.impala.catalog.Table.getFullName(), com.cloudera.impala.analysis.InsertStmt.partitionKeyValues_, and com.cloudera.impala.analysis.InsertStmt.table_.
Referenced by com.cloudera.impala.analysis.InsertStmt.analyze().
|
inlineprivate |
Checks for type compatibility of column and expr. Returns compatible (possibly cast) expr.
Definition at line 559 of file InsertStmt.java.
References com.cloudera.impala.catalog.Type.isValid(), com.cloudera.impala.analysis.InsertStmt.targetTableName_, and com.cloudera.impala.analysis.TableName.toSql().
Referenced by com.cloudera.impala.analysis.InsertStmt.prepareExpressions().
|
inline |
Definition at line 145 of file InsertStmt.java.
References com.cloudera.impala.analysis.InsertStmt.InsertStmt().
|
inline |
Definition at line 633 of file InsertStmt.java.
References com.cloudera.impala.analysis.InsertStmt.overwrite_, com.cloudera.impala.analysis.InsertStmt.partitionKeyExprs_, and com.cloudera.impala.analysis.InsertStmt.table_.
|
inline |
Definition at line 629 of file InsertStmt.java.
References com.cloudera.impala.analysis.InsertStmt.partitionKeyExprs_.
|
inline |
Definition at line 618 of file InsertStmt.java.
References com.cloudera.impala.analysis.InsertStmt.planHints_.
|
inline |
Only valid after analysis
Definition at line 627 of file InsertStmt.java.
References com.cloudera.impala.analysis.InsertStmt.queryStmt_.
|
inline |
Definition at line 631 of file InsertStmt.java.
References com.cloudera.impala.analysis.InsertStmt.resultExprs_.
|
inline |
Definition at line 620 of file InsertStmt.java.
References com.cloudera.impala.analysis.InsertStmt.table_.
|
inline |
Definition at line 619 of file InsertStmt.java.
References com.cloudera.impala.analysis.InsertStmt.targetTableName_.
|
inlineinherited |
Definition at line 43 of file StatementBase.java.
References com.cloudera.impala.analysis.StatementBase.isExplain_.
|
inline |
Definition at line 622 of file InsertStmt.java.
References com.cloudera.impala.analysis.InsertStmt.overwrite_.
|
inline |
Definition at line 630 of file InsertStmt.java.
References com.cloudera.impala.analysis.InsertStmt.isRepartition_.
|
inlineprivate |
Performs three final parts of the analysis:
If necessary, adds casts to the expressions to make them compatible with the type of the corresponding column.
AnalysisException | If an expression is not compatible with its target column |
Definition at line 467 of file InsertStmt.java.
References com.cloudera.impala.analysis.InsertStmt.checkTypeCompatibility(), com.cloudera.impala.catalog.Table.getColumns(), com.cloudera.impala.catalog.Table.getColumnsInHiveOrder(), com.cloudera.impala.catalog.Column.getPosition(), com.cloudera.impala.analysis.InsertStmt.needsGeneratedQueryStatement_, com.cloudera.impala.analysis.InsertStmt.partitionKeyExprs_, com.cloudera.impala.analysis.InsertStmt.partitionKeyValues_, com.cloudera.impala.analysis.InsertStmt.queryStmt_, com.cloudera.impala.analysis.InsertStmt.resultExprs_, and com.cloudera.impala.analysis.InsertStmt.table_.
Referenced by com.cloudera.impala.analysis.InsertStmt.analyze().
|
inlineinherited |
Definition at line 42 of file StatementBase.java.
References com.cloudera.impala.analysis.StatementBase.isExplain_.
|
inline |
Definition at line 628 of file InsertStmt.java.
References com.cloudera.impala.analysis.InsertStmt.queryStmt_.
|
inlineprivate |
Sets table_ based on targetTableName_ and performs table-type specific analysis:
Definition at line 298 of file InsertStmt.java.
References com.cloudera.impala.catalog.Type.BOOLEAN, com.cloudera.impala.catalog.Table.getDb(), com.cloudera.impala.catalog.HdfsTable.getFirstLocationWithoutWriteAccess(), com.cloudera.impala.catalog.Table.getFullName(), com.cloudera.impala.catalog.HdfsTable.getLocation(), com.cloudera.impala.catalog.Column.getName(), com.cloudera.impala.catalog.Table.getName(), com.cloudera.impala.catalog.Column.getType(), com.cloudera.impala.catalog.HdfsTable.hasWriteAccess(), com.cloudera.impala.authorization.Privilege.INSERT, com.cloudera.impala.common.FileSystemUtil.isDistributedFileSystem(), com.cloudera.impala.analysis.TableName.isFullyQualified(), com.cloudera.impala.analysis.InsertStmt.overwrite_, com.cloudera.impala.analysis.InsertStmt.partitionKeyValues_, com.cloudera.impala.catalog.HdfsTable.spansMultipleFileSystems(), com.cloudera.impala.analysis.InsertStmt.table_, and com.cloudera.impala.analysis.InsertStmt.targetTableName_.
Referenced by com.cloudera.impala.analysis.InsertStmt.analyze().
|
inline |
Definition at line 621 of file InsertStmt.java.
|
inline |
Implements com.cloudera.impala.analysis.ParseNode.
Definition at line 640 of file InsertStmt.java.
References com.cloudera.impala.analysis.InsertStmt.columnPermutation_, com.cloudera.impala.analysis.InsertStmt.needsGeneratedQueryStatement_, com.cloudera.impala.analysis.InsertStmt.originalTableName_, com.cloudera.impala.analysis.InsertStmt.overwrite_, com.cloudera.impala.analysis.InsertStmt.partitionKeyValues_, com.cloudera.impala.analysis.InsertStmt.planHints_, and com.cloudera.impala.analysis.InsertStmt.withClause_.
|
private |
|
protectedinherited |
|
private |
Definition at line 85 of file InsertStmt.java.
Referenced by com.cloudera.impala.analysis.InsertStmt.analyzePlanHints(), and com.cloudera.impala.analysis.InsertStmt.isRepartition().
|
staticprivate |
Definition at line 47 of file InsertStmt.java.
|
private |
|
private |
Definition at line 53 of file InsertStmt.java.
Referenced by com.cloudera.impala.analysis.InsertStmt.InsertStmt(), and com.cloudera.impala.analysis.InsertStmt.toSql().
|
private |
Definition at line 59 of file InsertStmt.java.
Referenced by com.cloudera.impala.analysis.InsertStmt.createDataSink(), com.cloudera.impala.analysis.InsertStmt.InsertStmt(), com.cloudera.impala.analysis.InsertStmt.isOverwrite(), com.cloudera.impala.analysis.InsertStmt.setTargetTable(), and com.cloudera.impala.analysis.InsertStmt.toSql().
|
private |
Definition at line 80 of file InsertStmt.java.
Referenced by com.cloudera.impala.analysis.InsertStmt.createDataSink(), com.cloudera.impala.analysis.InsertStmt.getPartitionKeyExprs(), and com.cloudera.impala.analysis.InsertStmt.prepareExpressions().
|
private |
Definition at line 63 of file InsertStmt.java.
Referenced by com.cloudera.impala.analysis.InsertStmt.analyze(), com.cloudera.impala.analysis.InsertStmt.analyzePlanHints(), com.cloudera.impala.analysis.InsertStmt.checkColumnCoverage(), com.cloudera.impala.analysis.InsertStmt.InsertStmt(), com.cloudera.impala.analysis.InsertStmt.prepareExpressions(), com.cloudera.impala.analysis.InsertStmt.setTargetTable(), and com.cloudera.impala.analysis.InsertStmt.toSql().
|
private |
|
private |
Definition at line 70 of file InsertStmt.java.
Referenced by com.cloudera.impala.analysis.InsertStmt.analyze(), com.cloudera.impala.analysis.InsertStmt.getQueryStmt(), com.cloudera.impala.analysis.InsertStmt.InsertStmt(), com.cloudera.impala.analysis.InsertStmt.prepareExpressions(), and com.cloudera.impala.analysis.InsertStmt.setQueryStmt().
|
private |
Definition at line 91 of file InsertStmt.java.
Referenced by com.cloudera.impala.analysis.InsertStmt.getResultExprs(), and com.cloudera.impala.analysis.InsertStmt.prepareExpressions().
|
private |
Definition at line 77 of file InsertStmt.java.
Referenced by com.cloudera.impala.analysis.InsertStmt.analyze(), com.cloudera.impala.analysis.InsertStmt.analyzePlanHints(), com.cloudera.impala.analysis.InsertStmt.checkColumnCoverage(), com.cloudera.impala.analysis.InsertStmt.createDataSink(), com.cloudera.impala.analysis.InsertStmt.getTargetTable(), com.cloudera.impala.analysis.InsertStmt.InsertStmt(), com.cloudera.impala.analysis.InsertStmt.prepareExpressions(), and com.cloudera.impala.analysis.InsertStmt.setTargetTable().
|
private |
Definition at line 56 of file InsertStmt.java.
Referenced by com.cloudera.impala.analysis.InsertStmt.checkTypeCompatibility(), com.cloudera.impala.analysis.InsertStmt.getTargetTableName(), com.cloudera.impala.analysis.InsertStmt.InsertStmt(), and com.cloudera.impala.analysis.InsertStmt.setTargetTable().
|
private |
Definition at line 50 of file InsertStmt.java.
Referenced by com.cloudera.impala.analysis.InsertStmt.analyze(), com.cloudera.impala.analysis.InsertStmt.InsertStmt(), and com.cloudera.impala.analysis.InsertStmt.toSql().