-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Labels
Description
chaining 2 functions with literal resolution didn't happen in v2 engine:
SELECT * FROM tbl WHERE val > ToEpochDays(fromDateTime('1970-01-15', 'yyyy-MM-dd'))
Execution Plan
LogicalAggregate(group=[{}], agg#0=[COUNT($0)])
PinotLogicalExchange(distribution=[hash])
LogicalAggregate(group=[{}], agg#0=[COUNT()])
LogicalFilter(condition=[<($9, ToEpochDays(1209600000:BIGINT))]) <-- problem
it apparently only evaluates single layer of rex literal
- for example here
1970-01-15 00:00:00
SELECT * FROM tbl WHERE CAST(val AS TIMESTAMP) > fromDateTime('1970-01-15', 'yyyy-MM-dd')
Execution Plan
LogicalAggregate(group=[{}], agg#0=[COUNT($0)])
PinotLogicalExchange(distribution=[hash])
LogicalAggregate(group=[{}], agg#0=[COUNT()])
LogicalFilter(condition=[<(CAST($9):TIMESTAMP(0) NOT NULL, 1970-01-15 00:00:00)])
- and here:
14:BIGINT
SELECT * FROM tbl WHERE val > ToEpochDays(1209600000)
Execution Plan
LogicalAggregate(group=[{}], agg#0=[COUNT($0)])
PinotLogicalExchange(distribution=[hash])
LogicalAggregate(group=[{}], agg#0=[COUNT()])
LogicalFilter(condition=[<($9, 14:BIGINT)])