InsertIntoStatement¶
InsertIntoStatement
is a UnaryParsedStatement.
Creating Instance¶
InsertIntoStatement
takes the following to be created:
- Table (LogicalPlan)
- Partition Specification (
Map[String, Option[String]]
) - User-specified column names
- Query
-
overwrite
flag -
ifPartitionNotExists
flag
InsertIntoStatement
is created when:
- Catalyst DSL is used to insertInto
AstBuilder
is requested to withInsertInto- DataFrameWriter.insertInto operator is used
Logical Resolution¶
InsertIntoStatement
is resolved to the following logical operators:
- InsertIntoDataSourceCommand (for
InsertIntoStatement
s over LogicalRelation over InsertableRelation) by DataSourceAnalysis - InsertIntoHadoopFsRelationCommand (for
InsertIntoStatement
s over LogicalRelation over HadoopFsRelation) by DataSourceAnalysis
Logical Analysis¶
InsertIntoStatement
s with UnresolvedCatalogRelation
s are resolved by the following logical analysis rules:
- FindDataSourceTable
FallBackFileSourceV2
PreprocessTableInsertion
- PreWriteCheck