OFFSET clause in SQL query

classic Classic list List threaded Threaded
2 messages Options
alex.glau alex.glau
Reply | Threaded
Open this post in threaded view
|

OFFSET clause in SQL query

Hi,

Do you support OFFSET clause in SQL query? I tried query with WHERE criteria and LIMIT that worked fine but after I added OFFSET the result is empty.
I got execution plan like the following:

[SELECT
    SHIPMENT.NAME AS __C0,
    SHIPMENT.STATUS AS __C1,
    SEGMENT.STARTSITENAME AS __C2
FROM "ShipmentCache".CACHEDSHIPMENT SHIPMENT
    /* "ShipmentCache"."group_shipment": STATUS = ?1
        AND STARTDATE < ?2
     */
    /* WHERE (SHIPMENT.STATUS = ?1)
        AND (SHIPMENT.STARTDATE < ?2)
    */
INNER JOIN "ShipmentSegmentCache".CACHEDSHIPMENTSEGMENT SEGMENT
    /* "ShipmentSegmentCache"."group_segment": SHIPMENTID = SHIPMENT.ID
        AND STARTSITENAME = ?3
     */
    ON 1=1
WHERE (SEGMENT.SHIPMENTID = SHIPMENT.ID)
    AND ((SEGMENT.STARTSITENAME = ?3)
    AND ((SHIPMENT.STATUS = ?1)
    AND (SHIPMENT.STARTDATE < ?2)))
LIMIT 30]

[SELECT
    __C0 AS NAME,
    __C1 AS STATUS,
    __C2 AS STARTSITENAME
FROM "ShipmentSegmentCache".__Z0()
    /* function */
LIMIT 30 OFFSET 30]
Sergi Vladykin Sergi Vladykin
Reply | Threaded
Open this post in threaded view
|

Re: OFFSET clause in SQL query

It is a bug in query generator. Thanks for reporting, I fixed this in master.

https://issues.apache.org/jira/browse/IGNITE-1259

Sergi

2015-08-16 12:12 GMT+03:00 alex.glau <[hidden email]>:
Hi,

Do you support OFFSET clause in SQL query? I tried query with WHERE criteria
and LIMIT that worked fine but after I added OFFSET the result is empty.
I got execution plan like the following:

[SELECT
    SHIPMENT.NAME AS __C0,
    SHIPMENT.STATUS AS __C1,
    SEGMENT.STARTSITENAME AS __C2
FROM "ShipmentCache".CACHEDSHIPMENT SHIPMENT
    /* "ShipmentCache"."group_shipment": STATUS = ?1
        AND STARTDATE < ?2
     */
    /* WHERE (SHIPMENT.STATUS = ?1)
        AND (SHIPMENT.STARTDATE < ?2)
    */
INNER JOIN "ShipmentSegmentCache".CACHEDSHIPMENTSEGMENT SEGMENT
    /* "ShipmentSegmentCache"."group_segment": SHIPMENTID = SHIPMENT.ID
        AND STARTSITENAME = ?3
     */
    ON 1=1
WHERE (SEGMENT.SHIPMENTID = SHIPMENT.ID)
    AND ((SEGMENT.STARTSITENAME = ?3)
    AND ((SHIPMENT.STATUS = ?1)
    AND (SHIPMENT.STARTDATE < ?2)))
LIMIT 30]

[SELECT
    __C0 AS NAME,
    __C1 AS STATUS,
    __C2 AS STARTSITENAME
FROM "ShipmentSegmentCache".__Z0()
    /* function */
LIMIT 30 OFFSET 30]



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/OFFSET-clause-in-SQL-query-tp990.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.