Danny Chen created CALCITE-4145: ----------------------------------- Summary: Exception when query from UDF field with structured type Key: CALCITE-4145 URL: https://issues.apache.org/jira/browse/CALCITE-4145 Project: Calcite Issue Type: Bug Components: core Affects Versions: 1.24.0, 1.23.0 Reporter: Danny Chen Assignee: Danny Chen Fix For: 1.25.0
Check this sql in {{SqlToRelConverterTest}} {code:java} @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(); } {code} {{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. -- This message was sent by Atlassian Jira (v8.3.4#803005)