Description
Query
SELECT a FROM (SELECT a FROM (SELECT a FROM test ORDER BY a LIMIT 3 OFFSET 2) i(a) ORDER BY a OFFSET 1 ) t(a)
Should be transformed into
Limit(offset=[1]), id = 201 Limit(offset=[2], fetch=[3]), id = 200 Exchange(distribution=[single]), id = 199 Sort(sort0=[$0], dir0=[ASC], offset=[2], fetch=[3]), id = 198 TableScan(table=[[PUBLIC, TEST]], requiredColumns=[{0}]), id = 168
But it gets rewritten as
Limit(offset=[1]), id = 201 Limit(offset=[2], fetch=[3]), id = 200 Exchange(distribution=[single]), id = 199 Sort(sort0=[$0], dir0=[ASC], offset=[1], fetch=[1]), id = 198 TableScan(table=[[PUBLIC, TEST]], requiredColumns=[{0}]), id = 168
Attachments
Issue Links
- Discovered while testing
-
IGNITE-21946 Cover SQL F863(Nested <result offset clause> in <query expression>) feature by tests
- Resolved
- is caused by
-
IGNITE-18479 Sort out and merge Calcite tickets to Ignite 3.0 (step 9)
- Resolved
- links to