You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "alamb (via GitHub)" <gi...@apache.org> on 2023/03/24 19:30:00 UTC

[GitHub] [arrow-datafusion] alamb commented on a diff in pull request #5723: LIMIT edge cases

alamb commented on code in PR #5723:
URL: https://github.com/apache/arrow-datafusion/pull/5723#discussion_r1147981211


##########
datafusion/core/tests/sqllogictests/test_files/select.slt:
##########
@@ -105,4 +105,24 @@ select
 ----
 false true false true true false false true false true true false true true false false true
 
+# select limit clause 

Review Comment:
   I double checked the results match postgres:
   
   ```sql
   postgres=# select * from (select 1 a union all select 2) b order by a limit 1;
    a
   ---
    1
   (1 row)
   
   postgres=# select * from (select 1 a union all select 2) b order by a limit -1;
   ERROR:  LIMIT must not be negative
   postgres=# select * from (select 1 a union all select 2) b order by a limit null;
    a
   ---
    1
    2
   (2 rows)
   
   postgres=# select * from (select 1 a union all select 2) b order by a limit 0;
    a
   ---
   (0 rows)
   
   ```
   
   👍 



-- 
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.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org