Skip to content

Commit

Permalink
read_parquet_mergetree test
Browse files Browse the repository at this point in the history
  • Loading branch information
akvlad committed Oct 8, 2024
1 parent 2ccd043 commit 596ce0d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
File renamed without changes.
19 changes: 19 additions & 0 deletions test/sql/chsql.test → chsql/test/sql/chsql.test
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ Catalog Error: Scalar Function with name chsql does not exist!
# Require statement will ensure this test is run with this extension loaded
require chsql

require parquet

# Confirm the extension works
query I
SELECT chsql('Works');
Expand Down Expand Up @@ -386,3 +388,20 @@ query I
SELECT bitCount(7) -- Binary: 111
----
3

# read_mergetree
statement ok
copy (select number * 2 as n from numbers(100000)) TO '__TEST_DIR__/1.parquet';

statement ok
copy (select number * 2 + 1 as n from numbers(100000)) TO '__TEST_DIR__/2.parquet';

query I
select count() as c from read_parquet_mergetree(ARRAY['__TEST_DIR__/1.parquet', '__TEST_DIR__/2.parquet'], 'n');
----
200000

query I
select count() as c from (select n - lag(n) over () as diff from read_parquet_mergetree(ARRAY['__TEST_DIR__/1.parquet', '__TEST_DIR__/2.parquet'], 'n')) where diff <0;
----
0

0 comments on commit 596ce0d

Please sign in to comment.