Conversation
|
seems like you could replace expression with |
Yes, I tried that and it works, but I chatted with the ClickHouse developers who said that, in the absence of benchmarking, it's likely that |
|
my point is that when we have |
Yeah, that was my first thought, too, though I've been leaving such optimizations to the underlying planner. Can confirm it returns |
|
And also I wanted to minimize the work we were doing, with an eye to rip it all out when we someday drop support for ClickHouse 24. |
Prior to ClickHouse 25, an `IN` expression with no values, e.g., `WHERE x = IN()`, fails with an error. An alternative is to use `has([], x)`, which does not fail on earlier versions Revise the code that determines when to use `IN` to detect when an `ANY` expression has passed an empty array, and if so, disqualify it for use in an `IN()` expression. This lets it continue with the `has()` function, instead. Add tests to validate this behavior, and include a note to replace the new function, `is_ok_in_expr()`, with the original, simpler `IsA(expr, Const)` expression.
Prior to ClickHouse 25, an
INexpression with no values, e.g.,WHERE x = IN(), fails with an error. An alternative is to usehas([], x), which does not fail on earlier versionsRevise the code that determines when to use
INto detect when anANYexpression has passed an empty array, and if so, disqualify it for use in anIN()expression. This lets it continue with thehas()function, instead. Add tests to validate this behavior, and include a note to replace the new function,is_ok_in_expr(), with the original, simplerIsA(expr, Const)expression.Resolves #275.