Martijn Visser created FLINK-41741:
--------------------------------------

             Summary: CEIL and FLOOR on a DECIMAL column fail with an 
AssertionError when assertions are on
                 Key: FLINK-41741
                 URL: https://issues.apache.org/jira/browse/FLINK-41741
             Project: Flink
          Issue Type: Bug
          Components: Table SQL / Runtime
            Reporter: Martijn Visser


DecimalDataUtils.ceil and floor return a DecimalData with the precision of the 
BigDecimal, not the precision of the declared result type. 
AbstractBinaryWriter.writeDecimal asserts value.precision() == precision, so 
CEIL(d) over a multi-row VALUES of DECIMAL(2, 1) fails with an AssertionError 
in the tests, which run with -ea. Without assertions the result is correct. No 
test covers this: ExpressionTestBase casts results to VARCHAR before writing 
them. FLINK-41726 describes the same kind of mismatch for the scale of ROUND 
and TRUNCATE.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to