question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Join queries with order by clause doesn't work

See original GitHub issue

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

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
abhishekagarwal87commented, Oct 6, 2022
0reactions
somu-implycommented, Oct 6, 2022

The test case has been added through #13173

Read more comments on GitHub >

github_iconTop Results From Across the Web

Order by in Inner Join - Stack Overflow
When you do an INNER JOIN, SQL Server determines the best way to find the matching rows (nested loops, etc). This results in...
Read more >
How to optimize a query with JOINs and ORDER BY?
Is it possible to optimize a query with both JOIN s and ORDER BY as long as the ORDER BY clause only targets...
Read more >
SQL join tables with group by and order by - w3resource
In this page, we are going to discuss the usage of GROUP BY and ORDER BY clause within a join. Here is a...
Read more >
MySQL Bugs: #69528: ORDER BY doesn't work with JOIN
ORDER BY seems to work if there's no WHERE... so seems to be the combination of a JOIN, WHERE and ORDER BY yields...
Read more >
How Join Order Can Affect the Query Plan - MSSQLTips.com
Generally speaking the SQL Server Optimizer will try to first join the tables that allows it to work with the smallest result set...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found