kylin-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ShaoFeng Shi <shaofeng...@apache.org>
Subject Re: paged query
Date Sat, 22 Jul 2017 03:11:22 GMT
The following SQL works in my side:

select * from KYLIN_SALES  LIMIT 100
OFFSET  1 ROWS  FETCH FIRST 10 ROWS ONLY

Here are two tricky things:

1) In Kylin's web GUI, it will automatically append a "LIMIT" after each
SQL if "LIMIT" wasn't appeared (this is to avoid too much data returned to
the web client); But in Calcite's grammer, "LIMIT" should appear before
"OFFSET"; so to bypass it I add the LIMIT here. If you send the query from
JDBC/ODBC or Rest API, there should be no such issue.

2) Calcite's document misses the "ONLY" keyword after "ROWS".

@Julian, can you confirm the issue 2)? thanks!



2017-07-21 17:59 GMT+08:00 apache_dev@163.com <apache_dev@163.com>:

> Hi,
>
>   Kylin can support paged query? This  sql can't work
>
>
>      select * from KYLIN_SALES   OFFSET  100 ROWS  FETCH FIRST 10 ROWS
>
>
>
> Calcite doc:
>
>   query:
> values | WITH withItem [ , withItem ]* query | { select |
> selectWithoutFrom | query UNION [ ALL | DISTINCT ] query | query EXCEPT [
> ALL | DISTINCT ] query | query MINUS [ ALL | DISTINCT ] query | query
> INTERSECT [ ALL | DISTINCT ] query } [ ORDER BY orderItem [, orderItem ]* ]
> [ LIMIT { count | ALL } ] [ OFFSET start { ROW | ROWS } ] [ FETCH { FIRST |
> NEXT } [ count ] { ROW | ROWS } ]
>
>
>
> apache_dev@163.com
>



-- 
Best regards,

Shaofeng Shi 史少锋

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message