Will Briggs
01/22/2021, 4:56 PMSELECT dimension, SUM(metric) AS totalMetrics FROM myTable WHERE otherDimension='filterValue' AND eventTimestamp >= cast(now() - 172800000 as long) GROUP BY 1 ORDER BY 2 DESC LIMIT 10
This one uses the star tree:
SELECT dimension, SUM(metric) AS totalMetrics FROM myTable WHERE otherDimension='filterValue' AND eventTimestamp >= 1611161288000 GROUP BY 1 ORDER BY 2 DESC LIMIT 10
It looks like the use of a dynamically-computed timestamp value is confusing the optimizer somehow? the eventTimestamp
column is not part of my star-tree index in either case.Mayank
Will Briggs
01/22/2021, 5:31 PMMayank
cast(now() - 172800000 as long)
. You can file an issue for the same.Will Briggs
01/22/2021, 6:03 PMMayank
Will Briggs
01/22/2021, 6:16 PMextractPredicateEvaluatorsMap
, and not in isFitForStarTree
?Mayank
isFitForStarTree
is the high level entry point for you to get the algorithm. The code that passes the predicateColumns is the one that needs to be checked.Will Briggs
01/22/2021, 6:18 PMMayank
Will Briggs
01/22/2021, 6:20 PMMayank
StarTreeUtils.extractPredicateEvaluatorsMap
Will Briggs
01/22/2021, 6:30 PMMayank
Will Briggs
01/22/2021, 8:36 PMJackie
01/22/2021, 8:41 PM1611161288000
is in micros instead of millisMayank
I did a simple test to compile the query to BrokerRequest, and do see cast(now() - 172800000 as long) as LHS for predicate. My test did not actually go through any query execution.
Will Briggs
01/22/2021, 8:43 PMJackie
01/22/2021, 8:45 PMMayank
Jackie
01/22/2021, 8:55 PMWill Briggs
01/22/2021, 8:56 PMMayank
Will Briggs
01/22/2021, 8:57 PMMayank
Jackie
01/22/2021, 9:03 PMWill Briggs
01/22/2021, 9:03 PMPinotQuery2BrokerRequestConverter
(or thereabouts) that is reifying eligible expressions into constants (e.g., now()
) before handing the query off from the Broker for execution, and it isn’t handling cast
function expressions?Jackie
01/22/2021, 9:04 PM