Repository navigation
Fix GROUP BY (const CTE) in distributed queries. - #64519
Conversation
|
This is an automated comment for commit d3bdb73 with description of existing statuses. It's updated for the latest CI running ❌ Click here to open a full report in a separate page
Successful checks
|
| nodes.pop(); | ||
|
|
||
| if (node->getNodeType() == QueryTreeNodeType::QUERY) | ||
| /// Allow scalar subqueries and IN; we send them to all the shards. |
There was a problem hiding this comment.
Sorry for my lack of knowledge about the context: Does this mean that we send the result of the scalar subquery / result of IN, or that we send the subquery themselves?
And another thing, but it depends on the previous response: would it make sense to change the name of the function (if we send the subquery itself)? At this point I only know it has to do with distributed queries because I've seen other related changes so maybe it could be more clear or we could add some comments to the function itself to explain what is used for? Thanks!
There was a problem hiding this comment.
I also don't understand this change. It sounds strange that we treat scalar subquery as a deterministic constant.
There was a problem hiding this comment.
This function is used to check whether the constant values is the same for all the replicas/shards. If the constant was calculated from the result of scalar subquery, or the constant was calculated as const_expr IN set, it would be the same : we send the result of scalar subqueries in the protocol.
Please, opt for the better function name.
Backport #64519 to 24.3: Fix GROUP BY (const CTE) in distributed queries.
Backport #64519 to 24.4: Fix GROUP BY (const CTE) in distributed queries.
Backport #64519 to 24.5: Fix GROUP BY (const CTE) in distributed queries.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):
Fix an error
Cannot find columnin distributed queries with constant CTE in theGROUP BYkey.Closes: #64498