i want use apache drill to do a page search. But it just provide a limit key words,I don't know how to write a good sql.Do any anybody can help me?Thank you!
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Drill supports both LIMIT and OFFSET operators. So, pagination can be achieved using these.
Sample query:
SELECT * FROM cp.`employee.json` order by employee_id LIMIT 20 OFFSET 10 ROWS
Some important ponits from Drill docs:
The OFFSET number must be a positive integer and cannot be larger than the number of rows in the underlying result set or no rows are returned. You can use the OFFSET clause in conjunction with the LIMIT and ORDER BY clauses.
When used with the LIMIT option, OFFSET rows are skipped before starting to count the LIMIT rows that are returned. If the LIMIT option is not used, the number of rows in the result set is reduced by the number of rows that are skipped.
The rows skipped by an OFFSET clause still have to be scanned, so it might be inefficient to use a large OFFSET value.
标签:
apache-drill