Apache Phoenix LIMIT OFFSET错误

时间:2016-09-07 08:28:33

标签: phoenix squirrel-sql

我需要知道错误的含义以及如何调试它。 这就是我所做的。

查询1:

SELECT * FROM us_population ORDER BY population DESC;

结果1:

NY  New York        8143197
CA  Los Angeles     3844829
IL  Chicago         2842518
TX  Houston         2016582
PA  Philadelphia    1463281
AZ  Phoenix         1461575
TX  San Antonio     1256509
CA  San Diego       1255540
TX  Dallas          1213825
CA  San Jose        912332

QUERY2:

SELECT * FROM us_population ORDER BY population DESC LIMIT 5;

结果2:

NY  New York        8143197
CA  Los Angeles     3844829
IL  Chicago         2842518
TX  Houston         2016582
PA  Philadelphia    1463281

QUERY3:

SELECT * FROM us_population ORDER BY population DESC LIMIT 5 OFFSET 5;

Result3:

Error: Error -1 (00000) : Error while executing SQL "SELECT * FROM vhen_test_population ORDER BY population DESC LIMIT 5 OFFSET 5": Remote driver error: RuntimeException: org.apache.phoenix.exception.PhoenixParserException: ERROR 602 (42P00): Syntax error. Missing "EOF" at line 1, column 69. -> PhoenixParserException: ERROR 602 (42P00): Syntax error. Missing "EOF" at line 1, column 69. -> MissingTokenException: (null exception message)
SQLState:  00000
ErrorCode: -1

1 个答案:

答案 0 :(得分:1)

使用最新版本的Phoenix,

版本4.8.0具有对分页查询的偏移支持

请参阅https://phoenix.apache.org/paged.html