Repository navigation
Fix remote predicate pushdown not respect literal types - #77093
Conversation
Signed-off-by: Duc Canh Le <[email protected]>
Signed-off-by: Duc Canh Le <[email protected]>
Signed-off-by: Duc Canh Le <[email protected]>
| { | ||
| auto literal = std::make_shared<ASTLiteral>((*node->column)[0]); | ||
| node_to_ast[node] = std::move(literal); | ||
| /// Need to enforce type of the literal, because some type is not comparable to its native type |
There was a problem hiding this comment.
when I took your example (https://fiddle.clickhouse.com/f6d2dbb1-e863-421a-ab5e-7ef372597947), I saw this query sent to shards:
SELECT `__table1`.`d` AS `d`, count() AS `count()`
FROM `default`.`t` AS `__table1`
WHERE `__table1`.`event` != ''
GROUP BY `__table1`.`d`
HAVING (`d` >= 20119) AND ((`__table1`.`d` >= _CAST(20119, 'Date')) AND (count() >= 1)is it right that (d >= 20119) in HAVING comes from the code you've fixed? and now we will send another _CAST(20119, 'Date') instead?
There was a problem hiding this comment.
when I took your example (https://fiddle.clickhouse.com/f6d2dbb1-e863-421a-ab5e-7ef372597947), I saw this query sent to shards:
SELECT `__table1`.`d` AS `d`, count() AS `count()` FROM `default`.`t` AS `__table1` WHERE `__table1`.`event` != '' GROUP BY `__table1`.`d` HAVING (`d` >= 20119) AND ((`__table1`.`d` >= _CAST(20119, 'Date')) AND (count() >= 1)is it right that
(d >= 20119)inHAVINGcomes from the code you've fixed? and now we will send another_CAST(20119, 'Date')instead?
@nickitat yes. Have to admit that I don't fully understand the remote predicate pushdown logic yet, so can't see why we have duplicated predicates.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Reproduce in head: https://fiddle.clickhouse.com/c13009f9-2228-44c5-8c20-36a8cca31622