Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id C6390200CDB for ; Sat, 22 Jul 2017 05:12:06 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id C30A016BB67; Sat, 22 Jul 2017 03:12:06 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 149BA16BB48 for ; Sat, 22 Jul 2017 05:12:05 +0200 (CEST) Received: (qmail 36867 invoked by uid 500); 22 Jul 2017 03:12:05 -0000 Mailing-List: contact dev-help@kylin.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@kylin.apache.org Delivered-To: mailing list dev@kylin.apache.org Received: (qmail 36843 invoked by uid 99); 22 Jul 2017 03:12:05 -0000 Received: from mail-relay.apache.org (HELO mail-relay.apache.org) (140.211.11.15) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 22 Jul 2017 03:12:05 +0000 Received: from mail-pg0-f49.google.com (mail-pg0-f49.google.com [74.125.83.49]) by mail-relay.apache.org (ASF Mail Server at mail-relay.apache.org) with ESMTPSA id 7B2EF1A0185 for ; Sat, 22 Jul 2017 03:12:03 +0000 (UTC) Received: by mail-pg0-f49.google.com with SMTP id k14so35648262pgr.0 for ; Fri, 21 Jul 2017 20:12:03 -0700 (PDT) X-Gm-Message-State: AIVw1105LD4yeFWJk1vmue/dGZ5I22zumOmhTN/HA55Dyw3RtFK/xn1C p+uF+y849lZCHZQ4t6T3NvGdOd5fUQ== X-Received: by 10.98.9.19 with SMTP id e19mr9589670pfd.177.1500693122441; Fri, 21 Jul 2017 20:12:02 -0700 (PDT) MIME-Version: 1.0 Received: by 10.100.165.48 with HTTP; Fri, 21 Jul 2017 20:11:22 -0700 (PDT) In-Reply-To: <201707211759333072873@163.com> References: <201707211759333072873@163.com> From: ShaoFeng Shi Date: Sat, 22 Jul 2017 11:11:22 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: paged query To: dev , jhyde@apache.org Content-Type: multipart/alternative; boundary="001a11499f687ae4920554df5835" archived-at: Sat, 22 Jul 2017 03:12:07 -0000 --001a11499f687ae4920554df5835 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 : > 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 > --=20 Best regards, Shaofeng Shi =E5=8F=B2=E5=B0=91=E9=94=8B --001a11499f687ae4920554df5835--