caicancai commented on code in PR #3890:
URL: https://github.com/apache/calcite/pull/3890#discussion_r1697806954
##########
arrow/src/test/java/org/apache/calcite/adapter/arrow/ArrowAdapterTest.java:
##########
@@ -518,6 +518,56 @@ static void initializeArrowState(@TempDir Path
sharedTempDir) throws IOException
.explainContains(plan);
}
+ @Test void testDecimalProject() {
+ String sql = "select SAL from EMP";
+ String plan = "PLAN=ArrowToEnumerableConverter\n"
+ + " ArrowProject(SAL=[$5])\n"
+ + " ArrowTableScan(table=[[ARROW, EMP]], fields=[[0, 1, 2, 3, 4, 5,
6, 7]])\n\n";
+ String result = "SAL=800.00\n"
+ + "SAL=1600.00\n"
+ + "SAL=1250.00\n";
+ CalciteAssert.that()
+ .with(arrow)
+ .query(sql)
+ .limit(3)
+ .returns(result)
+ .explainContains(plan);
+ }
+
+ @Test void testCastDecimalToSmallInt() {
+ String sql = "select CAST(LOSAL AS SMALLINT) from SALGRADE";
+ String plan =
+ "PLAN=EnumerableCalc(expr#0..2=[{inputs}],
expr#3=[CAST($t1):SMALLINT], EXPR$0=[$t3])\n"
+ + " ArrowToEnumerableConverter\n"
+ + " ArrowTableScan(table=[[ARROW, SALGRADE]], fields=[[0, 1,
2]])\n\n";
+ String result = "EXPR$0=700\n";
+
+ CalciteAssert.that()
+ .with(arrow)
+ .query(sql)
+ .typeIs("[EXPR$0 SMALLINT]")
+ .limit(1)
+ .returns(result)
+ .explainContains(plan);
+ }
+
+ @Test void testCastDecimalToTinyInt() {
Review Comment:
I noticed that there are similar tests, such as testCastDecimalToInt. I
don't know how this test is related to pushdown. I would be grateful if you can
answer my doubts.
--
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]