We are not able to get any order by clause

public Enumerable<Object[]> scan(DataContext dataContext, List<RexNode> 
filters) {
....
}

In the above function of filterable table we get only the where clause in the 
List<RexNode> filters.

For example:
Select * from users order by name limit 100;

In case of above query the filters list is empty.

Select * from users where age > 18 order by name limit 100;

In case of above query the filters list has only the where clause (age > 18).

So, no info about sort, limit or offset if present in the query.


________________________________
From: Mihai Budiu <mbu...@gmail.com>
Sent: Tuesday, September 17, 2024 2:06 PM
To: dev@calcite.apache.org <dev@calcite.apache.org>
Cc: Harshit Dwivedi <harshit.dwiv...@rockwellautomation.com>; Dipesh Sachdev 
<dipesh.sach...@rockwellautomation.com>; Thomas Keller <tkel...@ra.rockwell.com>
Subject: EXTERNAL: Re: Questions Regarding Implementing LIMIT Clause Pushdown 
in Apache Calcite JDBC Driver


[Use caution with links & attachments]



Isn't limit stored in an order by clause, with potentially an empty list of 
fields to sort on?
________________________________
From: Vishal Kore <vishal.k...@rockwellautomation.com.INVALID>
Sent: Tuesday, September 17, 2024 1:17:15 AM
To: dev@calcite.apache.org <dev@calcite.apache.org>
Cc: Harshit Dwivedi <harshit.dwiv...@rockwellautomation.com>; Dipesh Sachdev 
<dipesh.sach...@rockwellautomation.com>; Thomas Keller <tkel...@ra.rockwell.com>
Subject: Questions Regarding Implementing LIMIT Clause Pushdown in Apache 
Calcite JDBC Driver

Hi Devs,

I am currently working on implementing (or extending) a JDBC driver for my 
backend storage system using Apache Calcite. I've implemented the 
FilterableTable interface, which allows pushing down WHERE clause filters to 
the backend using the scan(DataContext ctx, List<RexNode> filters) method.
However, I'm struggling to push down the LIMIT clause to ensure that only the 
required number of records are retrieved from the backend. I cannot figure out 
how to access the LIMIT clause within the scan method.
Could you please guide me on how to retrieve or implement the LIMIT clause in 
this context?
Thanks for your assistance!
Best regards,
Vishal Kore

Reply via email to