- Notifications
You must be signed in to change notification settings - Fork 3
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
CREATE TABLE tpch.region ( r_regionkey INTEGER NOT NULL, r_name CHAR(25) NOT NULL, r_comment VARCHAR(152));
When an aggregate function is used, no query results are returned because filter condition is simplified.
EXPLAIN PLAN FOR SELECT SUM(r_regionkey) FROM tpch.region WHERE r_name = 'MIDDLE EAST'; +--------------------------------------------------------------------------+ | PLAN | +--------------------------------------------------------------------------+ | JdbcToEnumerableConverter JdbcAggregate(group=[{}], EXPR$0=[SUM($0)]) JdbcFilter(condition=[=($1, 'MIDDLE EAST ')]) JdbcTableScan(table=[[traindb, TPCH_1G, REGION]]) | +--------------------------------------------------------------------------+
Without the aggregate function, the filter condition is not simplified as follows.
EXPLAIN PLAN FOR SELECT * FROM tpch.region WHERE r_name = 'MIDDLE EAST'; +------------------------------------------------------------------------+ | PLAN | +------------------------------------------------------------------------+ | JdbcToEnumerableConverter JdbcFilter(condition=[=($1, CAST('MIDDLE EAST'):CHAR(25) NOT NULL)]) JdbcTableScan(table=[[traindb, TPCH_1G, REGION]]) | +------------------------------------------------------------------------+
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working