Igor Guzenko created CALCITE-3393:
-------------------------------------
Summary: 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
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)