Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Join queries with order by clause doesn't work #13163

Open
7Luma opened this issue Sep 30, 2022 · 6 comments
Open

Join queries with order by clause doesn't work #13163

7Luma opened this issue Sep 30, 2022 · 6 comments

Comments

@7Luma
Copy link

7Luma commented Sep 30, 2022

Hi!
Join queries with order by clause doesn't work

Affected Version

0.23.0, 0.24.0

Description

Queries like (with join and order by clause):

SELECT "T1"."__time"
FROM "SomeTableA" AS "T1"
JOIN "SomeTableB" AS "T2"
ON "T1"."A" = "T2"."B"
ORDER BY "T1"."__time" ASC

Doesn't work at 0.23.0 and 0.24.0 versions of Druid (but works at 0.22.0).
"Doesn't work" means that query processing ends with exception on broker node:

Error: Unknown exception
Cannot convert query parts into an actual query
org.apache.druid.sql.calcite.rel.CannotBuildQueryException

More detailed log here:
broker.log

@JLuma
Copy link

JLuma commented Oct 5, 2022

@gianm Can you please share you thoughts on this issue? Or maybe some info/details is missing?
It's looks like a significant bug.

@gianm
Copy link
Contributor

gianm commented Oct 6, 2022

We haven't had a chance to write a unit test demonstrating this problem yet. If you have one you could share, that would certainly accelerate the process, and would be very appreciated! It would go in CalciteJoinQueryTest. If not, that's ok, we will come around to do it on our own.

@abhishekagarwal87
Copy link
Contributor

I think #12418 caused it.
@somu-imply FYI.

@somu-imply
Copy link
Contributor

I'll add the unit test. Seems like #13173 fixes this. The query under consideration is

select t1.__time 
from foo as t1
JOIN numFoo as t2
on t1.dim2 = t2.dim2
order by t1.__time ASC

I'll update the unit test case with this query

@gianm
Copy link
Contributor

gianm commented Oct 6, 2022

Thanks for looking into it @somu-imply!

@somu-imply
Copy link
Contributor

The test case has been added through #13173

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants