findepi commented on issue #12103:
URL: https://github.com/apache/datafusion/issues/12103#issuecomment-2307760145

   > This logic coerces all value tuples to cast to the type of the value in 
the first row. 
   
   it would be better to coerce all values to their common super type (order 
insensitive, nor biased to the first row)
   
   > In the case of an insert into a UInt64 column, this can end up needlessly 
attempting to cast a valid UInt64 to a Int64 before being casted back to a 
UInt64 during plan execution.
   
   That's a good point. In INSERT's case one could want each value to 
_independently_ get coerced to the target type.
   However, this would be INSERT-specific special behavior which could lead to 
hard-to-understand inconsistencies later.
   `INSERT INTO <table> VALUES ...` is just a case of `INSERT INTO <table 
<select-query>`. 
   `INSERT INTO <table> VALUES ...` should behave exactly same as `INSERT INTO 
<table> SELECT * FROM (VALUES ...)` or `INSERT INTO <table> SELECT * FROM 
(VALUES ...) WHERE true`. In those more elaborate cases it's obvious that 
VALUES need to coerce to their common type.
   
   


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to