RequireTimeCondition does not handle complex joins
- Dominant language
- Java
- Stars
- 14.1k
- Forks
- 3.8k
- Avg merge
- 2d 58m
- Merged PRs (30d)
- 233
Description
Enabling druid.sql.planner.requireTimeCondition results in valid join queries being blocked.
Example -
SELECT distinct T1.dim1, T2.dim2 FROM
(SELECT dim1 from druid.foo WHERE dim1 <> '' AND __time >= '2000-01-01') AS T1,
(SELECT dim2 from druid.foo WHERE dim1 <> '' AND __time >= '2000-02-01') AS T2
WHERE T1.dim1=T2.dim2
Both the nested queries have a time filter for the above inner join, however the requireTimeCondition logic is looking for a time filter on the top level query.
Contributor guide
Research direction
Reproduce the supplied join query with druid.sql.planner.requireTimeCondition enabled, then trace the RequireTimeCondition logic in the SQL planner. Compare its handling of nested subqueries with a query lacking time filters; done means valid joins whose inner queries each have time filters are allowed without weakening rejection of unsafe queries.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, sql
- Domain
- databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100