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
Describe the bug
When the new LogicalPlan::Dml node for the UPDATE SQL statement is being generated during logical planning, the existence of the assignment target columns is never checked (unlike the existence of the assignment expression and selection expression columns).
To Reproduce
cd datafusion-cli
cargo run
...
❯ create table person (age int) asvalues (35);
0 rows inset. Query took 0.056 seconds.
❯ select*from person;
+-----+
| age |
+-----+
| 35 |
+-----+1 row inset. Query took 0.017 seconds.
❯ update person set nonexistent =36;
Internal("Unsupported logical plan: Dml")
❯ update person set age =36where nonexistent = true;
SchemaError(FieldNotFound { field: Column { relation: None, name: "nonexistent" }, valid_fields: [Column { relation: None, name: "age" }] })
❯ update person set age = (nonexistent +1);
SchemaError(FieldNotFound { field: Column { relation: None, name: "nonexistent" }, valid_fields: [Column { relation: None, name: "age" }] })
The Unsupported logical plan: Dml comes from the physical planning phase. In other words the logical plane has been created successfully.
Expected behavior
Target column existence should be checked during logical planning and the FieldNotFound error should be thrown when the column is missing. Otherwise a typo will result in a valid logical plan, which when executed will not contain the changes the user intends/assumes.
Additional context
None
The text was updated successfully, but these errors were encountered:
Describe the bug
When the new
LogicalPlan::Dml
node for theUPDATE
SQL statement is being generated during logical planning, the existence of the assignment target columns is never checked (unlike the existence of the assignment expression and selection expression columns).To Reproduce
cd datafusion-cli cargo run ...
The
Unsupported logical plan: Dml
comes from the physical planning phase. In other words the logical plane has been created successfully.Expected behavior
Target column existence should be checked during logical planning and the
FieldNotFound
error should be thrown when the column is missing. Otherwise a typo will result in a valid logical plan, which when executed will not contain the changes the user intends/assumes.Additional context
None
The text was updated successfully, but these errors were encountered: