apache / apache/druid

Offset is not processed correctly

Open
#15,254 5 comments 0 reactions 0 assignees View on GitHub
Bug Feature/Change Description stale
Dominant language
Java
Stars
14.1k
Forks
3.8k
Avg merge
2d 58m
Merged PRs (30d)
233

Description

table `foo` has 6 rows; the query:
```sql
SELECT
FLOOR(__time TO DAY) t,
COUNT(1)
FROM ( select * from foo order by __time offset 3 ) f
group by FLOOR(__time TO DAY)
```
return 6 rows; regardless of the `offset` inside the subq

Contributor guide

Open the contributing guide

Research direction

The issue names no files or tests. Reproduce the SQL query against a six-row table, then trace how OFFSET in the ordered subquery is handled; done means the subquery's offset changes the rows seen by the outer grouping query.

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
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.