Repository navigation
Conversation
`tryBuildAdditionalFilterAST` rebuilt constants from `ActionsDAG` with
`IColumn::getField`, so `fromUnixTimestamp64Milli(0, 'UTC')` was pushed to
remote shards as `_CAST('0', 'DateTime64(3, \'UTC\')')`. The shard then failed
with `CANNOT_PARSE_DATETIME`.
Use `getFieldFromColumnForASTLiteral` to serialize typed literals before
wrapping them in `_CAST`, matching analyzer constant conversion.
Closes: #94612
|
Workflow [PR], commit [d522c9d] Summary: ❌
AI ReviewSummary
Final Verdict
|
| @@ -0,0 +1,44 @@ | |||
| -- Tags: no-parallel-replicas | |||
There was a problem hiding this comment.
Pull request overview
Fixes distributed predicate pushdown when rebuilding additional filters that contain DateTime64 constants, preventing shard-side exceptions like CANNOT_PARSE_DATETIME caused by incorrectly reconstructed literals.
Changes:
- Rebuild constant filter literals using
getFieldFromColumnForASTLiteralsoDate/DateTime/DateTime64values are encoded as typed text literals before_CAST. - Add a stateless regression test covering
DateTime64(3, 'UTC')filter pushdown throughremote(...).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/Processors/QueryPlan/ReadFromRemote.cpp | Uses typed literal extraction when converting ActionsDAG constants back into AST for pushed-down remote filters. |
| tests/queries/0_stateless/04340_datetime64_distributed_filter_pushdown.sql | Adds a stateless query reproducer to ensure DateTime64 constants don’t break distributed filter pushdown. |
| tests/queries/0_stateless/04340_datetime64_distributed_filter_pushdown.reference | Adds expected output for the new stateless regression test. |
|
I ran this solution against test suite in the (freshly updated) #95055, results: Cases PR #108425 handles correctly
Cases PR #108425 misses
I would recommend to close this PR in favor of #95055 |
|
Dear @scanhex12, you haven't been active on this PR for 30 days. You will be unassigned. Will you continue working on it? If so, please feel free to reassign yourself. |
Closes: #94612
Fix rebuilding pushed-down distributed filters with
DateTime64constants.tryBuildAdditionalFilterASTpreviously createdASTLiteralfrom the raw column field, sofromUnixTimestamp64Milli(0, 'UTC')was sent to shards as_CAST('0', 'DateTime64(3, \'UTC\')'), which raisesCANNOT_PARSE_DATETIME.The change uses the same typed-literal conversion as analyzer constants and adds a stateless regression test.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fixed distributed predicate pushdown for filters with
DateTime64constants, which could previously fail withCANNOT_PARSE_DATETIME.Documentation entry for user-facing changes