tkalkirill commented on code in PR #13569:
URL: https://github.com/apache/ignite/pull/13569#discussion_r4104000518
##########
modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/integration/UserDefinedFunctionsIntegrationTest.java:
##########
@@ -492,6 +504,383 @@ public void testBigDecimalFunctionArgument() {
assertQuery("SELECT udf.decimalToInt(5.3)").returns(5).check();
}
+ /** */
+ @Test
+ public void testObjectTableFunctionResult() {
+ client.getOrCreateCache(new
CacheConfiguration<>("object-table-functions")
+ .setSqlSchema("PUBLIC")
+ .setSqlFunctionClasses(CustomTypeFunctionsLibrary.class));
+
+ Object[] exp = temporalValues();
+
+ assertQuery("SELECT * FROM objectTableValues()")
+ .withResultChecker(rows -> {
+ assertEquals(1, rows.size());
+ assertEquals(exp.length, rows.get(0).size());
+
+ for (int i = 0; i < exp.length; i++) {
+ Object actual = rows.get(0).get(i);
+
+ assertEquals("Unexpected value type at index " + i,
exp[i].getClass(), actual.getClass());
+ assertEquals("Unexpected value at index " + i, exp[i],
actual);
+ }
+ })
+ .check();
+ }
+
+ /** */
+ @Test
+ public void testSerializableTableFunctionResult() {
Review Comment:
`Serializable` exercises a different type-mapping path: `Object.class`
becomes Ignite’s `OtherType`, while `Serializable.class` becomes Calcite’s
`ROW` type. The test checks that a `java.sql.Date` value in such a column
remains unchanged instead of being converted to an integer based on its runtime
class. The `Object` test only covers the custom `OtherType` path.
--
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]