-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use explicit enum for physical errors #2
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,30 +26,54 @@ create table t1(a int, b varchar, c double, d int); | |
statement ok | ||
set datafusion.optimizer.max_passes = 0; | ||
|
||
query T | ||
query TT | ||
explain update t1 set a=1, b=2, c=3.0, d=NULL; | ||
---- | ||
This feature is not implemented: Unsupported logical plan: Dml(Update) | ||
logical_plan | ||
01)Dml: op=[Update] table=[t1] | ||
02)--Projection: CAST(Int64(1) AS Int32) AS a, CAST(Int64(2) AS Utf8) AS b, Float64(3) AS c, CAST(NULL AS Int32) AS d | ||
03)----TableScan: t1 | ||
physical_plan_error This feature is not implemented: Unsupported logical plan: Dml(Update) | ||
|
||
query T | ||
query TT | ||
explain update t1 set a=c+1, b=a, c=c+1.0, d=b; | ||
---- | ||
This feature is not implemented: Unsupported logical plan: Dml(Update) | ||
logical_plan | ||
01)Dml: op=[Update] table=[t1] | ||
02)--Projection: CAST(t1.c + CAST(Int64(1) AS Float64) AS Int32) AS a, CAST(t1.a AS Utf8) AS b, t1.c + Float64(1) AS c, CAST(t1.b AS Int32) AS d | ||
03)----TableScan: t1 | ||
physical_plan_error This feature is not implemented: Unsupported logical plan: Dml(Update) | ||
|
||
statement ok | ||
create table t2(a int, b varchar, c double, d int); | ||
|
||
## set from subquery | ||
query T | ||
query TT | ||
explain update t1 set b = (select max(b) from t2 where t1.a = t2.a) | ||
---- | ||
This feature is not implemented: Physical plan does not support logical expression ScalarSubquery(<subquery>) | ||
logical_plan | ||
01)Dml: op=[Update] table=[t1] | ||
02)--Projection: t1.a AS a, (<subquery>) AS b, t1.c AS c, t1.d AS d | ||
03)----Subquery: | ||
04)------Projection: max(t2.b) | ||
05)--------Aggregate: groupBy=[[]], aggr=[[max(t2.b)]] | ||
06)----------Filter: outer_ref(t1.a) = t2.a | ||
07)------------TableScan: t2 | ||
08)----TableScan: t1 | ||
physical_plan_error This feature is not implemented: Physical plan does not support logical expression ScalarSubquery(<subquery>) | ||
|
||
# set from other table | ||
query T | ||
query TT | ||
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; | ||
---- | ||
This feature is not implemented: Unsupported logical plan: Dml(Update) | ||
logical_plan | ||
01)Dml: op=[Update] table=[t1] | ||
02)--Projection: t1.a AS a, t2.b AS b, CAST(t2.a AS Float64) AS c, CAST(Int64(1) AS Int32) AS d | ||
03)----Filter: t1.a = t2.a AND t1.b > Utf8("foo") AND t2.c > Float64(1) | ||
04)------Cross Join: | ||
05)--------TableScan: t1 | ||
06)--------TableScan: t2 | ||
physical_plan_error This feature is not implemented: Unsupported logical plan: Dml(Update) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this way we still see the logical explain, but now it is also clear there is a physical plan error |
||
|
||
statement ok | ||
create table t3(a int, b varchar, c double, d int); | ||
|
@@ -59,7 +83,15 @@ query error DataFusion error: SQL error: ParserError\("Expected end of statement | |
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; | ||
|
||
# test table alias | ||
query T | ||
query TT | ||
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; | ||
---- | ||
This feature is not implemented: Unsupported logical plan: Dml(Update) | ||
logical_plan | ||
01)Dml: op=[Update] table=[t1] | ||
02)--Projection: t.a AS a, t2.b AS b, CAST(t.a AS Float64) AS c, CAST(Int64(1) AS Int32) AS d | ||
03)----Filter: t.a = t2.a AND t.b > Utf8("foo") AND t2.c > Float64(1) | ||
04)------Cross Join: | ||
05)--------SubqueryAlias: t | ||
06)----------TableScan: t1 | ||
07)--------TableScan: t2 | ||
physical_plan_error This feature is not implemented: Unsupported logical plan: Dml(Update) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By adding an explicit new "plan type" it became clear how to show the errors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's what I want to do in the begining, but I didn't want to introduce many overhead so I changed it. Sometimes I am confused about balancing change size and simplicity. Thanks for your suggestion!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it is totally a judgement call
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, it is totally a judgement call -- I don't think there is ever one right answer