tkalkirill commented on code in PR #13543:
URL: https://github.com/apache/ignite/pull/13543#discussion_r3958611215


##########
modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/exec/rel/ExecutionTest.java:
##########
@@ -63,6 +79,51 @@ public class ExecutionTest extends AbstractExecutionTest {
         super.setup();
     }
 
+    /** */
+    @Test
+    public void testTableFunctionOtherValues() {
+        checkTableFunctionOtherValues(new 
BasicSqlType(IgniteTypeSystem.INSTANCE, SqlTypeName.OTHER));
+        checkTableFunctionOtherValues(new OtherType(true));
+    }
+
+    /** */
+    private void checkTableFunctionOtherValues(RelDataType colType) {
+        ExecutionContext<Object[]> ctx = executionContext();
+
+        // Bypass type canonization to test both representations of OTHER 
regardless of the shared type cache state.
+        RelDataType rowType = new RelRecordType(Collections.singletonList(new 
RelDataTypeFieldImpl("V", 0, colType)));
+
+        Object[] vals = {
+            new byte[] {1, 2, 3},
+            new java.util.Date(0),
+            Date.valueOf("2020-01-01"),
+            Time.valueOf("02:03:04"),
+            Timestamp.valueOf("2020-01-01 02:03:04"),
+            LocalDate.of(2020, 1, 1),
+            LocalTime.of(2, 3, 4),
+            LocalDateTime.of(2020, 1, 1, 2, 3, 4),
+            Duration.ofHours(2),
+            Period.ofMonths(3),
+            null
+        };
+
+        for (Object val : vals) {
+            Object[] row = {val};
+
+            for (Object container : new Object[] {row, 
Collections.singletonList(val)}) {
+                TableFunctionScan<Object[]> scan = new 
TableFunctionScan<>(ctx, rowType,
+                    () -> Collections.singletonList(container), 
ctx.rowHandler().factory(ctx.getTypeFactory(), rowType));
+
+                Object[] res = scan.iterator().next();
+
+                assertNotSame(row, res);
+                assertEquals(1, res.length);
+                assertSame(val, res[0]);
+                assertSame(val, row[0]);

Review Comment:
   Why?



-- 
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]

Reply via email to