Skip to content

Commit 759b52f

Browse files
UnresolvedTable Leaf Logical Operator
1 parent b60d358 commit 759b52f

File tree

2 files changed

+45
-13
lines changed

2 files changed

+45
-13
lines changed

docs/logical-operators/UnresolvedTable.md

+8-13
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,24 @@ title: UnresolvedTable
44

55
# UnresolvedTable Leaf Logical Operator
66

7-
`UnresolvedTable` is a [leaf logical operator](LeafNode.md).
7+
`UnresolvedTable` is an unresolved [leaf logical operator](LeafNode.md) (`UnresolvedLeafNode`) that represents a table that has yet to be looked up in a catalog.
88

99
## Creating Instance
1010

1111
`UnresolvedTable` takes the following to be created:
1212

1313
* <span id="multipartIdentifier"> Multi-Part Identifier
1414
* <span id="commandName"> Command Name
15+
* <span id="relationTypeMismatchHint"> Optional `relationTypeMismatchHint`
1516

1617
`UnresolvedTable` is created when:
1718

18-
* `AstBuilder` is requested to [visitLoadData](../sql/AstBuilder.md#visitLoadData), [visitTruncateTable](../sql/AstBuilder.md#visitTruncateTable), [visitShowPartitions](../sql/AstBuilder.md#visitShowPartitions), [visitAddTablePartition](../sql/AstBuilder.md#visitAddTablePartition), [visitDropTablePartitions](../sql/AstBuilder.md#visitDropTablePartitions), [visitCommentTable](../sql/AstBuilder.md#visitCommentTable)
19-
20-
## <span id="resolved"> resolved
21-
22-
```scala
23-
resolved: Boolean
24-
```
25-
26-
`resolved` is part of the [LogicalPlan](LogicalPlan.md#resolved) abstraction.
27-
28-
`resolved` is `false`.
19+
* `AstBuilder` is requested to [create an UnresolvedTable](../sql/AstBuilder.md#createUnresolvedTable)
20+
* `CatalogImpl` is requested to [recover partitions](../CatalogImpl.md#recoverPartitions)
2921

3022
## Logical Analysis
3123

32-
`UnresolvedTable` is resolved to a [ResolvedTable](ResolvedTable.md) by `ResolveTables` logical resolution rule.
24+
`UnresolvedTable` is resolved by [ResolveRelations](../logical-analysis-rules/ResolveRelations.md) logical resolution rule.
25+
26+
??? note "CheckAnalysis and AnalysisException"
27+
[CheckAnalysis](../CheckAnalysis.md#checkAnalysis0) reports an `AnalysisException` (`TABLE_OR_VIEW_NOT_FOUND`) when there are any `UnresolvedTable`s left in a logical query plan after logical analysis.

docs/sql/AstBuilder.md

+37
Original file line numberDiff line numberDiff line change
@@ -1132,3 +1132,40 @@ With no `namedArgumentExpression` used, `extractNamedArgument` creates an [Expre
11321132
`extractNamedArgument` is used when:
11331133

11341134
* `AstBuilder` is requested to [visitFunctionCall](#visitFunctionCall) and [visitTableValuedFunction](#visitTableValuedFunction)
1135+
1136+
## Create UnresolvedTable Logical Operator { #createUnresolvedTable }
1137+
1138+
```scala
1139+
createUnresolvedTable(
1140+
ctx: IdentifierReferenceContext,
1141+
commandName: String,
1142+
relationTypeMismatchHint: Option[String] = None): LogicalPlan
1143+
```
1144+
1145+
`createUnresolvedTable` creates an [UnresolvedTable](../logical-operators/UnresolvedTable.md) logical operator.
1146+
1147+
---
1148+
1149+
`createUnresolvedTable` is used when `AstBuilder` is requested for the following:
1150+
1151+
* [visitAddTableColumns](#visitAddTableColumns)
1152+
* [visitAddTablePartition](#visitAddTablePartition)
1153+
* [visitAlterTableAlterColumn](#visitAlterTableAlterColumn)
1154+
* [visitCommentTable](#visitCommentTable)
1155+
* [visitCreateIndex](#visitCreateIndex)
1156+
* [visitDropIndex](#visitDropIndex)
1157+
* [visitDropTableColumns](#visitDropTableColumns)
1158+
* [visitDropTablePartitions](#visitDropTablePartitions)
1159+
* [visitHiveChangeColumn](#visitHiveChangeColumn)
1160+
* [visitHiveReplaceColumns](#visitHiveReplaceColumns)
1161+
* [visitLoadData](#visitLoadData)
1162+
* [visitRecoverPartitions](#visitRecoverPartitions)
1163+
* [visitRenameTableColumn](#visitRenameTableColumn)
1164+
* [visitRenameTablePartition](#visitRenameTablePartition)
1165+
* [visitRepairTable](#visitRepairTable)
1166+
* [visitSetTableLocation](#visitSetTableLocation)
1167+
* [visitSetTableProperties](#visitSetTableProperties)
1168+
* [visitSetTableSerDe](#visitSetTableSerDe)
1169+
* [visitShowPartitions](#visitShowPartitions)
1170+
* [visitTruncateTable](#visitTruncateTable)
1171+
* [visitUnsetTableProperties](#visitUnsetTableProperties)

0 commit comments

Comments
 (0)