Skip to content

JOIN ... GROUP BY ... WITH TOTALS throwing exception on join #9839

@joshg

Description

@joshg

Following query (minute the aliases on the sub-queries) worked fine in 19.x (previous to requiring the ll and rr labels).

 SELECT
     id, yago, recent
 FROM (
     SELECT under_item_id AS id, SUM(price_sold) AS recent
     FROM by_item WHERE (date BETWEEN '2019-12-16' AND '2020-03-08')
     GROUP BY id WITH TOTALS
 ) ll
 FULL OUTER JOIN
 (
     SELECT under_item_id AS id, SUM(price_sold) AS yago
     FROM by_item WHERE (date BETWEEN '2018-12-17' AND '2019-03-10')
     GROUP BY id WITH TOTALS
 ) rr
 USING (id)

Now, in 20.3.4.10 it is throwing:

Code: 10. DB::Exception: Received from localhost:9000. DB::Exception: Not found column rr.id in block. There are only columns: id, yago.

If you remove the WITH TOTALS, it works. Seemingly getting confused with the combination of the gouped totals with the labels added?

Metadata

Metadata

Assignees

Labels

backward compatibilitybugConfirmed user-visible misbehaviour in official releasecomp-joinsJOINs end-to-end (planning hooks + runtime join operators/algorithms). Single bucket to avoid pla...

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions