jonahgao commented on code in PR #14223:
URL: https://github.com/apache/datafusion/pull/14223#discussion_r1926268514


##########
datafusion/sqllogictest/test_files/insert.slt:
##########
@@ -433,3 +433,30 @@ drop table test_column_defaults
 
 statement error DataFusion error: Error during planning: Column reference is 
not allowed in the DEFAULT expression : Schema error: No field named a.
 create table test_column_defaults(a int, b int default a+1)
+
+
+# test inserting UInt64 and signed integers into a bigint unsigned column
+statement ok
+create table unsigned_bigint_test (v bigint unsigned)
+
+query I
+insert into unsigned_bigint_test values (10000000000000000000), 
(18446744073709551615)
+----
+2
+
+query I
+insert into unsigned_bigint_test values (10000000000000000001), (1), 
(10000000000000000002)
+----
+3
+
+query I rowsort
+select * from unsigned_bigint_test

Review Comment:
   Overflow is unexpected in this case, as all these values are valid unsigned 
bigint.
   
   The problem is that in `values (10000000000000000001), (1)`, 
10000000000000000001 is parsed as `UInt64`, and 1 is parsed as `Int64`. They 
were coerced to `Int64`, which can't accommodate 10000000000000000001.
   
   This is very similar to the union case mentioned above.



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