Skip to content

Commit 2b5aa22

Browse files
committed
Update EXPLAIN for logical and physical planner checks
Adjust update.slt to ensure both EXPLAIN UPDATE ... FROM cases account for successful logical planning in addition to the existing physical-planner rejection. Align Utf8View cast with reports from sqllogictest in the filter for better consistency.
1 parent ac34b8b commit 2b5aa22

1 file changed

Lines changed: 25 additions & 6 deletions

File tree

datafusion/sqllogictest/test_files/update.slt

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,19 @@ logical_plan
6767
physical_plan_error This feature is not implemented: Physical plan does not support logical expression ScalarSubquery(<subquery>)
6868

6969
# set from other table
70-
# UPDATE ... FROM is currently unsupported
71-
# TODO fix https://github.com/apache/datafusion/issues/19950
72-
query error DataFusion error: This feature is not implemented: UPDATE ... FROM is not supported
70+
# UPDATE ... FROM now reaches logical planning, but the physical planner
71+
# still fails closed until joined update provider support lands.
72+
query TT
7373
explain update t1 set b = t2.b, c = t2.a, d = 1 from t2 where t1.a = t2.a and t1.b > 'foo' and t2.c > 1.0;
74+
----
75+
logical_plan
76+
01)Dml: op=[Update] table=[t1]
77+
02)--Projection: t1.a AS a, t2.b AS b, CAST(t2.a AS Float64) AS c, CAST(Int64(1) AS Int32) AS d
78+
03)----Filter: t1.a = t2.a AND t1.b > CAST(Utf8("foo") AS Utf8View) AND t2.c > Float64(1)
79+
04)------Cross Join:
80+
05)--------TableScan: t1
81+
06)--------TableScan: t2
82+
physical_plan_error This feature is not implemented: UPDATE ... FROM is not supported
7483

7584
# test update from other table with actual data
7685
statement ok
@@ -90,10 +99,20 @@ statement error DataFusion error: This feature is not implemented: Multiple tabl
9099
explain update t1 set b = t2.b, c = t3.a, d = 1 from t2, t3 where t1.a = t2.a and t1.a = t3.a;
91100

92101
# test table alias
93-
# UPDATE ... FROM is currently unsupported
94-
# TODO fix https://github.com/apache/datafusion/issues/19950
95-
statement error DataFusion error: This feature is not implemented: UPDATE ... FROM is not supported
102+
# UPDATE ... FROM with aliases also reaches logical planning, but execution
103+
# remains blocked in the physical planner for now.
104+
query TT
96105
explain update t1 as T set b = t2.b, c = t.a, d = 1 from t2 where t.a = t2.a and t.b > 'foo' and t2.c > 1.0;
106+
----
107+
logical_plan
108+
01)Dml: op=[Update] table=[t1]
109+
02)--Projection: t.a AS a, t2.b AS b, CAST(t.a AS Float64) AS c, CAST(Int64(1) AS Int32) AS d
110+
03)----Filter: t.a = t2.a AND t.b > CAST(Utf8("foo") AS Utf8View) AND t2.c > Float64(1)
111+
04)------Cross Join:
112+
05)--------SubqueryAlias: t
113+
06)----------TableScan: t1
114+
07)--------TableScan: t2
115+
physical_plan_error This feature is not implemented: UPDATE ... FROM is not supported
97116

98117
# test update with table alias with actual data
99118
statement ok

0 commit comments

Comments
 (0)