jonahgao opened a new pull request, #7922: URL: https://github.com/apache/arrow-datafusion/pull/7922
## Which issue does this PR close? N/A ## Rationale for this change Similar to insert: https://github.com/apache/arrow-datafusion/blob/08c1b69a4ec9e5ddeaefd2810c0624ce9d9a3b9b/datafusion/sql/src/statement.rs#L1149 Add a casting for the updated value to match the data type of the table’s column. **Current**: ```sh ❯ create table t1(a int, b varchar, c double); 0 rows in set. Query took 0.025 seconds. ❯ explain update t1 set a=1, b=2, c=3.0; +--------------+-------------------------------------------------------------+ | plan_type | plan | +--------------+-------------------------------------------------------------+ | logical_plan | Dml: op=[Update] table=[t1] | | | Projection: Int64(1) AS a, Int64(2) AS b, Float64(3) AS c | | | TableScan: t1 projection=[a] | +--------------+-------------------------------------------------------------+ ``` **After pr:** ```sh ❯ explain update t1 set a=1, b=2, c=3.0; +--------------+--------------------------------------------------------------+ | plan_type | plan | +--------------+--------------------------------------------------------------+ | logical_plan | Dml: op=[Update] table=[t1] | | | Projection: Int32(1) AS a, Utf8("2") AS b, Float64(3) AS c | | | TableScan: t1 projection=[] | +--------------+--------------------------------------------------------------+ 1 row in set. Query took 0.026 seconds. ``` ## What changes are included in this PR? <!-- There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR. --> ## Are these changes tested? Yes ## Are there any user-facing changes? No -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
