mihaibudiu commented on code in PR #4052:
URL: https://github.com/apache/calcite/pull/4052#discussion_r1859006752
##########
arrow/src/main/java/org/apache/calcite/adapter/arrow/ArrowFieldType.java:
##########
@@ -55,9 +45,20 @@ enum ArrowFieldType {
this.clazz = clazz;
}
+ ArrowFieldType(Class<?> clazz, int precision, int scale) {
Review Comment:
I think the other constructors should call this one.
There are some values in the type system for "unspecified", maybe these
could be reused.
Using 0 may not be always safe.
##########
arrow/src/test/java/org/apache/calcite/adapter/arrow/ArrowAdapterTest.java:
##########
@@ -732,8 +732,8 @@ static void initializeArrowState(@TempDir Path
sharedTempDir)
@Test void testFilteredAgg() {
String sql = "select SUM(SAL) FILTER (WHERE COMM > 400) as SALESSUM from
EMP";
String plan = "PLAN=EnumerableAggregate(group=[{}], SALESSUM=[SUM($0)
FILTER $1])\n"
- + " EnumerableCalc(expr#0..7=[{inputs}], expr#8=[400:DECIMAL(19, 0)],
expr#9=[>($t6, $t8)], "
- + "expr#10=[IS TRUE($t9)], SAL=[$t5], $f1=[$t10])\n"
+ + " EnumerableCalc(expr#0..7=[{inputs}],
expr#8=[CAST($t6):DECIMAL(10, 2)], expr#9=[400.00:DECIMAL(10, 2)], "
Review Comment:
can you also add or modify a test that uses a decimal number with digits
after the decimal point? This would exercise the scale.
--
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]