[
https://issues.apache.org/jira/browse/CALCITE-3393?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16958082#comment-16958082
]
Julian Hyde commented on CALCITE-3393:
--------------------------------------
[~IhorHuzenko] I noticed in this change and in CALCITE-3138 that you seem to be
generating {{SqlToRelConverterTest.xml}} by hand. It's better to use the copy
that is generated under {{core/target/surefire}}. It fills out the "sql"
property and it puts the resources into approximately alphabetical order so
that they don't conflict with other people's change.
You don't need to do anything - I'm about to commit a fix.
> RelStructuredTypeFlattener: improve support for functions with struct input
> ---------------------------------------------------------------------------
>
> Key: CALCITE-3393
> URL: https://issues.apache.org/jira/browse/CALCITE-3393
> Project: Calcite
> Issue Type: Improvement
> Components: core
> Reporter: Igor Guzenko
> Assignee: Igor Guzenko
> Priority: Minor
> Labels: pull-request-available
> Fix For: 1.22.0
>
> Time Spent: 1.5h
> Remaining Estimate: 0h
>
> 1.
> [RelStructuredTypeFlattener|https://github.com/apache/calcite/blob/148bfd329413c0272395cc0b7c322b3c5a34b667/core/src/main/java/org/apache/calcite/sql2rel/RelStructuredTypeFlattener.java#L376]
> doesn't support aggregate functions for struct type column.
> Example test case:
> {code:java}
> @Test
> public void testAggregateFunctionWithStructInput() {
> final String sql =
> "select count(dn.skill) from sales.dept_nested dn";
> sql(sql).ok();
> }
> {code}
> 2. For other functions, except ITEM, flattener uses first nested primitive
> field from
> original struct input. Example test case:
> {code:java}
> @Test
> public void testFunctionWithStructInput() {
> final String sql =
> "select json_type(dn.skill) from sales.dept_nested dn";
> sql(sql).ok();
> }
> {code}
> Generated plan:
> {code}
> LogicalProject(EXPR$0=[JSON_TYPE($2.TYPE)])
> LogicalTableScan(table=[[CATALOG, SALES, DEPT_NESTED]])
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)