[
https://issues.apache.org/jira/browse/CALCITE-5566?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
shampoo liu updated CALCITE-5566:
---------------------------------
Attachment: dump.dot
> agg can't be pushed down correctly
> ----------------------------------
>
> Key: CALCITE-5566
> URL: https://issues.apache.org/jira/browse/CALCITE-5566
> Project: Calcite
> Issue Type: Bug
> Components: core
> Affects Versions: 1.33.0
> Reporter: shampoo liu
> Priority: Major
> Attachments: dump.dot
>
>
> {code:sql}
> select count(*) from (select max("position_title") "position_title" from
> "foodmart"."employee" where "gender" like '%a%' group by "birth_date",
> "gender") where "position_title" like '%z%'
> {code}
> The plan generated from sql above is as this :
> {code:java}
> PLAN=EnumerableAggregate(group=[{}], EXPR$0=[COUNT()])
> JdbcToEnumerableConverter
> JdbcFilter(condition=[LIKE($2, '%z%')])
> JdbcAggregate(group=[{8, 15}], position_title=[MAX($5)])
> JdbcFilter(condition=[LIKE($15, '%a%')])
> JdbcTableScan(table=[[foodmart, employee]])
> {code}
> Expected:
> {code:java}
> PLAN=JdbcToEnumerableConverter
> JdbcAggregate(group=[{}], EXPR$0=[COUNT()])
> JdbcFilter(condition=[LIKE($2, '%z%')])
> JdbcAggregate(group=[{8, 15}], position_title=[MAX($5)])
> JdbcFilter(condition=[LIKE($15, '%a%')])
> JdbcTableScan(table=[[foodmart, employee]])
> {code}
> test case:
> https://github.com/shpodg/calcite/commit/7c7aa35ca9864243e39b8d0559f820c342860754
--
This message was sent by Atlassian Jira
(v8.20.10#820010)