UnresolvedRelation Logical Operator¶
UnresolvedRelation is a leaf logical operator with a name (as a NamedRelation) that represents a named relation that has yet to be looked up in a catalog at analysis.
UnresolvedRelation is never resolved and has to be replaced using ResolveRelations logical resolution rule.
UnresolvedRelation takes the following to be created:
- Multi-part identifier
UnresolvedRelation is created (possibly indirectly using apply factory) when:
AstBuilderis requested to parse TABLE statement and table name, and create an UnresolvedRelation
- DataFrameReader.table operator is used
- DataFrameWriterV2 operators are used:
DataStreamReader.table(Spark Structured Streaming) operator is used
SparkConnectPlanneris requested to transformReadRel
- table (Catalyst DSL) operator is used
apply( tableIdentifier: TableIdentifier): UnresolvedRelation apply( tableIdentifier: TableIdentifier, extraOptions: CaseInsensitiveStringMap, isStreaming: Boolean): UnresolvedRelation
apply creates an UnresolvedRelation.
apply is used when:
- DataFrameWriter.insertInto operator is used
- SparkSession.table operator is used
name is part of the NamedRelation abstraction.
name is quoted multi-part dot-separated table name.
Quoted Multi-Part Dot-Separated Table Name¶
tableName is a quoted multi-part
resolved is part of the LogicalPlan abstraction.
resolved is disabled (
nodePatterns is part of the TreeNode abstraction.
nodePatterns is a single-element collection with UNRESOLVED_RELATION.