kumarUjjawal commented on code in PR #19926:
URL: https://github.com/apache/datafusion/pull/19926#discussion_r2717898149
##########
datafusion/sqllogictest/test_files/scalar.slt:
##########
@@ -951,15 +951,29 @@ query TR
select arrow_typeof(round('12345.55'::decimal(10,2), -1)),
round('12345.55'::decimal(10,2), -1);
----
-Decimal128(10, 2) 12350
+Decimal128(11, 2) 12350
# round decimal256 keeps decimals
query TR
select arrow_typeof(round('1234.5678'::decimal(50,4), 2)),
round('1234.5678'::decimal(50,4), 2);
----
-Decimal256(50, 4) 1234.57
+Decimal256(51, 4) 1234.57
Review Comment:
Case | Input | Result | Type
-- | -- | -- | --
dp column | 123.4567, dp=1 | 123.5000 | DECIMAL(10,4)
carry-over | 999.9999, dp=0 | 1000.0000 | DECIMAL(10,4)
constant dp | 999.9 | 1000 | DECIMAL(4,0)
scale reduction | 1234.5678, dp=2 | 1234.57 | DECIMAL(50,2)
negative dp | 12345.67, dp=-2 | 12300 | DECIMAL(7,0)
dp > scale | 123.4, dp=5 | 123.4 | DECIMAL(4,1)
negative values | -999.9, dp=0 | -1000 | DECIMAL(4,0)
--
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]