forked from duckdb/duckdb
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
56 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# name: test/sql/storage/compression/dictionary/fetch_row.test | ||
# description: Test storage with Dictionary compression | ||
# group: [dictionary] | ||
|
||
require block_size 262144 | ||
|
||
# load the DB from disk | ||
load __TEST_DIR__/test_dictionary_fetchrow.db | ||
|
||
statement ok | ||
PRAGMA force_compression = 'dictionary' | ||
|
||
statement ok | ||
CREATE TABLE test ( | ||
a INTEGER, | ||
b VARCHAR | ||
); | ||
|
||
statement ok | ||
INSERT INTO test (a, b) | ||
SELECT x AS a, | ||
CASE (x - 1) % 5 | ||
WHEN 0 THEN 'aaaa' | ||
WHEN 1 THEN 'bbbb' | ||
WHEN 2 THEN 'cccc' | ||
WHEN 3 THEN 'dddd' | ||
WHEN 4 THEN NULL | ||
END AS b | ||
FROM range(10_000) t(x); | ||
|
||
statement ok | ||
CHECKPOINT | ||
|
||
restart | ||
|
||
query I | ||
SELECT compression FROM pragma_storage_info('test') WHERE segment_type ILIKE 'VARCHAR' LIMIT 1 | ||
---- | ||
Dictionary | ||
|
||
statement ok | ||
pragma verify_fetch_row; | ||
|
||
query I | ||
select distinct b from test order by a % 5; | ||
---- | ||
NULL | ||
aaaa | ||
bbbb | ||
cccc | ||
dddd |