maropu commented on a change in pull request #26311: [SPARK-29648][SQL][TESTS] Port limit.sql URL: https://github.com/apache/spark/pull/26311#discussion_r340453385
########## File path: sql/core/src/test/resources/sql-tests/inputs/postgreSQL/limit.sql ########## @@ -0,0 +1,164 @@ +-- Portions Copyright (c) 1996-2019, PostgreSQL Global Development Group +-- +-- LIMIT +-- https://github.com/postgres/postgres/blob/REL_12_STABLE/src/test/regress/sql/limit.sql + +SELECT '' AS two, unique1, unique2, stringu1 + FROM onek WHERE unique1 > 50 + ORDER BY unique1 LIMIT 2; +SELECT '' AS five, unique1, unique2, stringu1 + FROM onek WHERE unique1 > 60 + ORDER BY unique1 LIMIT 5; +SELECT '' AS two, unique1, unique2, stringu1 + FROM onek WHERE unique1 > 60 AND unique1 < 63 + ORDER BY unique1 LIMIT 5; +-- [SPARK-28330] ANSI SQL: Top-level <result offset clause> in <query expression> +-- SELECT '' AS three, unique1, unique2, stringu1 +-- FROM onek WHERE unique1 > 100 +-- ORDER BY unique1 LIMIT 3 OFFSET 20; +-- SELECT '' AS zero, unique1, unique2, stringu1 +-- FROM onek WHERE unique1 < 50 +-- ORDER BY unique1 DESC LIMIT 8 OFFSET 99; +-- SELECT '' AS eleven, unique1, unique2, stringu1 +-- FROM onek WHERE unique1 < 50 +-- ORDER BY unique1 DESC LIMIT 20 OFFSET 39; +-- SELECT '' AS ten, unique1, unique2, stringu1 +-- FROM onek +-- ORDER BY unique1 OFFSET 990; +-- SELECT '' AS five, unique1, unique2, stringu1 +-- FROM onek +-- ORDER BY unique1 OFFSET 990 LIMIT 5; +-- SELECT '' AS five, unique1, unique2, stringu1 +-- FROM onek +-- ORDER BY unique1 LIMIT 5 OFFSET 900; + +CREATE OR REPLACE TEMPORARY VIEW INT8_TBL AS SELECT * FROM + (VALUES + (123, 456), + (123, 4567890123456789), + (4567890123456789, 123), + (4567890123456789, 4567890123456789), + (4567890123456789, -4567890123456789)) + AS v(q1, q2); + +-- Test null limit and offset. The planner would discard a simple null +-- constant, so to ensure executor is exercised, do this: +-- [SPARK-29650] Discard a NULL constant in LIMIT +select * from int8_tbl limit (case when random() < 0.5 then bigint(null) end); Review comment: Filed: https://issues.apache.org/jira/browse/SPARK-29650 ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
