You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a ViewTable is created, the plan is run through the Analyzer with the ExpandWildcardRule and TypeCoercion rules. When this ViewTable is later inlined, it is run though the Analyzer again, but this second pass of TypeCoercion can drop the qualifier information in the DFSchema for fields of a union if a field had previously been cast.
statement ok
CREATE TABLE t1 (x INT, y INT);
statement ok
INSERT INTO t1 VALUES (3, 3), (3, 3), (1, 1);
statement ok
CREATE TABLE t3 (y BIGINT, z BIGINT);
statement ok
INSERT INTO t3 VALUES (20, 20), (40, 40);
statement ok
CREATE VIEW v1 AS
SELECT y FROM t1 UNION ALL SELECT y FROM t3;
query I
SELECT * FROM v1;
----
3
3
1
20
40
External error: query failed: DataFusion error: type_coercion
caused by
Schema error: No field named t1.y. Did you mean 'y'?.
[SQL] SELECT * FROM v1;
Describe the bug
When a ViewTable is created, the plan is run through the
Analyzer
with theExpandWildcardRule
andTypeCoercion
rules. When this ViewTable is later inlined, it is run though theAnalyzer
again, but this second pass ofTypeCoercion
can drop the qualifier information in theDFSchema
for fields of a union if a field had previously been cast.To Reproduce
Below is a test case that demonstrates the error
This will fail with:
Expected behavior
The above test should succeed.
Additional context
No response
The text was updated successfully, but these errors were encountered: