You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "gruuya (via GitHub)" <gi...@apache.org> on 2023/01/25 22:16:42 UTC

[GitHub] [arrow-datafusion] gruuya opened a new issue, #5068: UPDATE statment for non existent column doesn't error out

gruuya opened a new issue, #5068:
URL: https://github.com/apache/arrow-datafusion/issues/5068

   **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**
   ```bash
   cd datafusion-cli
   cargo run
   ...
   ```
   ```sql
   ❯ create table person (age int) as values (35);
   0 rows in set. Query took 0.056 seconds.
   ❯ select * from person;
   +-----+
   | age |
   +-----+
   | 35  |
   +-----+
   1 row in set. Query took 0.017 seconds.
   ❯ update person set nonexistent = 36;
   Internal("Unsupported logical plan: Dml")
   ❯ update person set age = 36 where 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
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-datafusion] alamb closed issue #5068: UPDATE statment for non existent column doesn't error out

Posted by "alamb (via GitHub)" <gi...@apache.org>.
alamb closed issue #5068: UPDATE statment for non existent column doesn't error out
URL: https://github.com/apache/arrow-datafusion/issues/5068


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org