@@ -3,8 +3,9 @@ create or replace database test_tbl_opt_parquet_encoding;
3
3
4
4
statement ok
5
5
use test_tbl_opt_parquet_encoding;
6
-
7
- # Test create table with parquet encoding option
6
+ #############################################
7
+ # Create table with parquet encoding option #
8
+ #############################################
8
9
9
10
statement ok
10
11
create or replace table t_encoded (c int, s string) enable_parquet_encoding = 'true' compression = 'lz4';
@@ -27,3 +28,52 @@ query T
27
28
select humanize_size(file_size) from fuse_block('test_tbl_opt_parquet_encoding', 't');
28
29
----
29
30
3.91 MiB
31
+
32
+ ################################
33
+ # Alter table parquet encoding #
34
+ ################################
35
+
36
+ statement ok
37
+ create or replace table tbl (c int, s string) compression = 'lz4';
38
+
39
+ statement ok
40
+ insert into tbl(c, s) select number as c, to_string(number) as s from numbers(500000);
41
+
42
+ query T
43
+ select humanize_size(file_size) from fuse_block('test_tbl_opt_parquet_encoding', 'tbl');
44
+ ----
45
+ 3.91 MiB
46
+
47
+ statement ok
48
+ ALTER TABLE tbl SET OPTIONS (enable_parquet_encoding = 'true');
49
+
50
+ statement ok
51
+ insert into tbl(c, s) select number as c, to_string(number) as s from numbers(500000);
52
+
53
+ # newly created block should be smaller, since enable_parquet_encoding is 'true'
54
+ query T
55
+ select humanize_size(file_size) from fuse_block('test_tbl_opt_parquet_encoding', 'tbl');
56
+ ----
57
+ 2.30 MiB
58
+ 3.91 MiB
59
+
60
+ statement ok
61
+ ALTER TABLE tbl SET OPTIONS (enable_parquet_encoding = 'false');
62
+
63
+ statement ok
64
+ insert into tbl(c, s) select number as c, to_string(number) as s from numbers(500000);
65
+
66
+ # newly created block should be larger, since enable_parquet_encoding is 'false'
67
+ query T
68
+ select humanize_size(file_size) from fuse_block('test_tbl_opt_parquet_encoding', 'tbl');
69
+ ----
70
+ 3.91 MiB
71
+ 2.30 MiB
72
+ 3.91 MiB
73
+
74
+ # Test invalid option value
75
+
76
+ statement error 1001
77
+ ALTER TABLE tbl SET OPTIONS (enable_parquet_encoding = 'invalid');
78
+
79
+
0 commit comments