caicancai commented on code in PR #4843:
URL: https://github.com/apache/calcite/pull/4843#discussion_r2994968701
##########
arrow/src/test/java/org/apache/calcite/adapter/arrow/ArrowAdapterDataTypesTest.java:
##########
@@ -222,4 +222,76 @@ static void initializeArrowState(@TempDir Path
sharedTempDir)
.returns(result)
.explainContains(plan);
}
+
+ /** Test case for
+ * <a
href="https://issues.apache.org/jira/browse/CALCITE-6646">[CALCITE-6646]
+ * Arrow adapter should support Timestamp data type</a>. */
+ @Test void testTimestampSecProject() {
+ String sql = "select \"timestampSecField\" from arrowdatatype";
+ String plan = "PLAN=ArrowToEnumerableConverter\n"
+ + " ArrowProject(timestampSecField=[$12])\n"
+ + " ArrowTableScan(table=[[ARROW, ARROWDATATYPE]], fields=[[0, 1,
2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]])\n\n";
+ String result = "timestampSecField=2024-01-01 00:00:00\n"
+ + "timestampSecField=2024-01-02 00:00:00\n";
+ CalciteAssert.that()
+ .with(arrow)
+ .query(sql)
+ .limit(2)
+ .returns(result)
+ .explainContains(plan);
+ }
+
+ /** Test case for
+ * <a
href="https://issues.apache.org/jira/browse/CALCITE-6646">[CALCITE-6646]
+ * Arrow adapter should support Timestamp data type</a>. */
+ @Test void testTimestampMilliProject() {
+ String sql = "select \"timestampMilliField\" from arrowdatatype";
+ String plan = "PLAN=ArrowToEnumerableConverter\n"
+ + " ArrowProject(timestampMilliField=[$13])\n"
+ + " ArrowTableScan(table=[[ARROW, ARROWDATATYPE]], fields=[[0, 1,
2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]])\n\n";
+ String result = "timestampMilliField=2024-01-01 00:00:00.000\n"
+ + "timestampMilliField=2024-01-02 00:00:00.000\n";
+ CalciteAssert.that()
+ .with(arrow)
+ .query(sql)
+ .limit(2)
+ .returns(result)
+ .explainContains(plan);
+ }
+
+ /** Test case for
+ * <a
href="https://issues.apache.org/jira/browse/CALCITE-6646">[CALCITE-6646]
+ * Arrow adapter should support Timestamp data type</a>. */
+ @Test void testTimestampMicroProject() {
Review Comment:
done, add `testTimestampNanoProject`
--
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]