[ 
https://issues.apache.org/jira/browse/CALCITE-4145?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Danny Chen resolved CALCITE-4145.
---------------------------------
    Resolution: Fixed

Fixed in 
[c52f0e5|https://github.com/apache/calcite/commit/c52f0e527c86f6a6b18e138310359ac0c72ca529]
 !

> 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.23.0, 1.24.0
>            Reporter: Danny Chen
>            Assignee: Danny Chen
>            Priority: Major
>             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)

Reply via email to