alamb commented on code in PR #6833:
URL: https://github.com/apache/arrow-datafusion/pull/6833#discussion_r1253430858


##########
datafusion/core/tests/sqllogictests/test_files/decimal.slt:
##########
@@ -603,3 +603,12 @@ query R
 select try_cast(1234567 as decimal(7,3));
 ----
 NULL
+
+statement ok
+create table foo (a DECIMAL(38, 20), b DECIMAL(38, 0));
+
+statement ok
+insert into foo VALUES (1, 5);
+
+query error DataFusion error: Arrow error: Compute error: Overflow happened 
on: 100000000000000000000 \* 100000000000000000000000000000000000000

Review Comment:
   FWIW this is what postgres does (treats it like a float, I think):
   
   ```
   postgres=# create table foo (a DECIMAL(38, 20), b DECIMAL(38, 0));
   CREATE TABLE
   postgres=# insert into foo VALUES (1, 5);
   INSERT 0 1
   postgres=# select a / b from foo;
           ?column?
   ------------------------
    0.20000000000000000000
   (1 row)
   ```



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

Reply via email to