Check this sql in SqlToRelConverterTest
@Test void testUdfWithStructuredReturnType() { final String sql = "SELECT deptno, tmp.r.not_null_field, tmp.r.nullable_field FROM\n" + "(SELECT deptno, ROW_FUNC() AS r from dept)tmp"; sql(sql).ok(); }
ArrayIndexOutOfBoundsException throws because the nested field got a -1 index when querying the field by simple name.
To solve the problem, for a nested field, return its parent field's monotonicity.
- links to