Skip to content

Commit 6f50265

Browse files
committed
tweak logic tests
1 parent e92f1e9 commit 6f50265

File tree

8 files changed

+29
-26
lines changed

8 files changed

+29
-26
lines changed

src/query/storages/fuse/src/io/write/virtual_column_builder.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ use databend_common_hashtable::StackHashMap;
5050
use databend_common_io::constants::DEFAULT_BLOCK_INDEX_BUFFER_SIZE;
5151
use databend_common_license::license::Feature;
5252
use databend_common_license::license_manager::LicenseManagerSwitch;
53-
use databend_storages_common_blocks::blocks_to_parquet;
53+
use databend_storages_common_blocks::blocks_to_parquet_with_stats;
5454
use databend_storages_common_table_meta::meta::DraftVirtualBlockMeta;
5555
use databend_storages_common_table_meta::meta::DraftVirtualColumnMeta;
5656
use databend_storages_common_table_meta::meta::Location;
@@ -506,13 +506,14 @@ impl VirtualColumnBuilder {
506506
gen_columns_statistics(&virtual_block, None, &virtual_block_schema)?;
507507

508508
let mut data = Vec::with_capacity(DEFAULT_BLOCK_INDEX_BUFFER_SIZE);
509-
let file_meta = blocks_to_parquet(
509+
let file_meta = blocks_to_parquet_with_stats(
510510
virtual_block_schema.as_ref(),
511511
vec![virtual_block],
512512
&mut data,
513513
write_settings.table_compression,
514514
write_settings.enable_parquet_dictionary,
515515
None,
516+
Some(&columns_statistics),
516517
)?;
517518

518519
let draft_virtual_column_metas = self.file_meta_to_virtual_column_metas(

tests/sqllogictests/suites/base/09_fuse_engine/09_0046_parquet_encoding.test

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@ use test_tbl_opt_parquet_encoding;
88
# Create table with parquet encoding option #
99
#############################################
1010

11+
12+
# by default, enable_parquet_dictionary = 'true'
1113
statement ok
12-
create or replace table t_encoded (c int, s string) enable_parquet_dictionary = 'true' storage_format = 'parquet';
14+
create or replace table t_encoded (c int, s string) storage_format = 'parquet';
1315

1416
statement ok
15-
create or replace table t(c int, s string) storage_format = 'parquet';
17+
create or replace table t(c int, s string) enable_parquet_dictionary = 'false' storage_format = 'parquet';
1618

1719
statement ok
1820
insert into t_encoded(c, s) select 1 as c, to_string(1) as s from numbers(1000000);
@@ -43,7 +45,7 @@ with
4345

4446
# 1. prepare plain encoded data and keep the file size
4547
statement ok
46-
create or replace table tbl (c int, s string) storage_format = 'parquet';
48+
create or replace table tbl (c int, s string) storage_format = 'parquet' enable_parquet_dictionary = 'false';
4749

4850
statement ok
4951
insert into tbl(c, s) select 1 as c, to_string(1) as s from numbers(1000000);

tests/sqllogictests/suites/ee/01_ee_system/01_0002_virtual_column.test

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -143,29 +143,29 @@ test_virtual_column t2 val 3000000002 ['c'] String
143143
query II
144144
select row_count, virtual_column_size from fuse_block('test_virtual_column', 't2')
145145
----
146-
3 833
146+
3 809
147147

148148
query III
149149
select block_count, row_count, virtual_column_size from fuse_segment('test_virtual_column', 't2');
150150
----
151-
1 3 833
151+
1 3 809
152152

153153
query III
154154
select block_count, row_count, virtual_column_size from fuse_snapshot('test_virtual_column', 't2');
155155
----
156-
1 3 833
156+
1 3 809
157157

158158
query IITTIII
159159
select virtual_block_size, row_count, column_name, column_type, column_id, block_offset, bytes_compressed from fuse_virtual_column('test_virtual_column', 't2')
160160
----
161-
833 3 val['a'] UInt64 NULL 3000000000 4 48
162-
833 3 val['b'] UInt64 NULL 3000000001 52 48
163-
833 3 val['c'] String NULL 3000000002 100 48
161+
809 3 val['a'] UInt64 NULL 3000000000 4 40
162+
809 3 val['b'] UInt64 NULL 3000000001 44 40
163+
809 3 val['c'] String NULL 3000000002 84 40
164164

165165
query IIIIII
166166
select block_count, row_count, bytes_uncompressed, bytes_compressed, index_size, virtual_block_count from fuse_segment('test_virtual_column', 't2')
167167
----
168-
1 3 134 712 1271 1
168+
1 3 134 734 1247 1
169169

170170
statement ok
171171
insert into t2 values(4, '{"a":44,"b":4,"c":"value"}'), (5, '{"a":55,"b":5,"c":"bend"}'), (6, '6')

tests/sqllogictests/suites/mode/cluster/filter_nulls.test

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ Exchange
6060
│ ├── scan id: 1
6161
│ ├── output columns: [value (#1)]
6262
│ ├── read rows: 1000
63-
│ ├── read size: 2.30 KiB
63+
│ ├── read size: 2.31 KiB
6464
│ ├── partitions total: 6
6565
│ ├── partitions scanned: 3
6666
│ ├── pruning stats: [segments: <range pruning: 2 to 1 cost: <slt:ignore>>, blocks: <range pruning: 3 to 3 cost: <slt:ignore>>]
@@ -75,7 +75,7 @@ Exchange
7575
├── scan id: 0
7676
├── output columns: [value (#0)]
7777
├── read rows: 2000
78-
├── read size: 3.94 KiB
78+
├── read size: 3.95 KiB
7979
├── partitions total: 6
8080
├── partitions scanned: 3
8181
├── pruning stats: [segments: <range pruning: 2 to 1 cost: <slt:ignore>>, blocks: <range pruning: 3 to 3 cost: <slt:ignore>>]
@@ -124,7 +124,7 @@ Exchange
124124
│ │ ├── scan id: 1
125125
│ │ ├── output columns: [value (#1)]
126126
│ │ ├── read rows: 1000
127-
│ │ ├── read size: 2.30 KiB
127+
│ │ ├── read size: 2.31 KiB
128128
│ │ ├── partitions total: 6
129129
│ │ ├── partitions scanned: 3
130130
│ │ ├── pruning stats: [segments: <range pruning: 2 to 1 cost: <slt:ignore>>, blocks: <range pruning: 3 to 3 cost: <slt:ignore>>]
@@ -139,7 +139,7 @@ Exchange
139139
│ ├── scan id: 2
140140
│ ├── output columns: [value (#2)]
141141
│ ├── read rows: 2000
142-
│ ├── read size: 3.94 KiB
142+
│ ├── read size: 3.95 KiB
143143
│ ├── partitions total: 6
144144
│ ├── partitions scanned: 3
145145
│ ├── pruning stats: [segments: <range pruning: 2 to 1 cost: <slt:ignore>>, blocks: <range pruning: 3 to 3 cost: <slt:ignore>>]
@@ -155,7 +155,7 @@ Exchange
155155
├── scan id: 0
156156
├── output columns: [value (#0)]
157157
├── read rows: 2000
158-
├── read size: 3.94 KiB
158+
├── read size: 3.95 KiB
159159
├── partitions total: 6
160160
├── partitions scanned: 3
161161
├── pruning stats: [segments: <range pruning: 2 to 1 cost: <slt:ignore>>, blocks: <range pruning: 3 to 3 cost: <slt:ignore>>]
@@ -190,7 +190,7 @@ Exchange
190190
│ ├── scan id: 1
191191
│ ├── output columns: [value (#1)]
192192
│ ├── read rows: 1000
193-
│ ├── read size: 2.30 KiB
193+
│ ├── read size: 2.31 KiB
194194
│ ├── partitions total: 6
195195
│ ├── partitions scanned: 3
196196
│ ├── pruning stats: [segments: <range pruning: 2 to 1 cost: <slt:ignore>>, blocks: <range pruning: 3 to 3 cost: <slt:ignore>>]
@@ -205,7 +205,7 @@ Exchange
205205
├── scan id: 0
206206
├── output columns: [value (#0)]
207207
├── read rows: 2000
208-
├── read size: 3.94 KiB
208+
├── read size: 3.95 KiB
209209
├── partitions total: 6
210210
├── partitions scanned: 3
211211
├── pruning stats: [segments: <range pruning: 2 to 1 cost: <slt:ignore>>, blocks: <range pruning: 3 to 3 cost: <slt:ignore>>]

tests/sqllogictests/suites/mode/cluster/lazy_read.test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ Limit
119119
├── scan id: 0
120120
├── output columns: [a (#0), b (#1), c (#2), d (#3), e (#6)]
121121
├── read rows: 200
122-
├── read size: 1.12 KiB
122+
├── read size: 1.26 KiB
123123
├── partitions total: 3
124124
├── partitions scanned: 2
125125
├── pruning stats: [segments: <range pruning: 3 to 3 cost: <slt:ignore>>, blocks: <range pruning: 3 to 3 cost: <slt:ignore>, topn pruning: 3 to 2 cost: <slt:ignore>>]

tests/sqllogictests/suites/mode/standalone/explain/fold_agg.test

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ AggregateFinal
8686
├── scan id: 0
8787
├── output columns: [number (#0)]
8888
├── read rows: 3000
89-
├── read size: 5.89 KiB
89+
├── read size: 5.90 KiB
9090
├── partitions total: 2
9191
├── partitions scanned: 2
9292
├── pruning stats: [segments: <range pruning: 2 to 2 cost: <slt:ignore>>, blocks: <range pruning: 2 to 2 cost: <slt:ignore>>]
@@ -110,7 +110,7 @@ AggregateFinal
110110
├── scan id: 0
111111
├── output columns: [number (#0)]
112112
├── read rows: 3000
113-
├── read size: 5.89 KiB
113+
├── read size: 5.90 KiB
114114
├── partitions total: 2
115115
├── partitions scanned: 2
116116
├── pruning stats: [segments: <range pruning: 2 to 2 cost: <slt:ignore>>, blocks: <range pruning: 2 to 2 cost: <slt:ignore>>]

tests/sqllogictests/suites/mode/standalone/explain/index/explain_ngram_index.test

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Filter
4747
├── scan id: 0
4848
├── output columns: [id (#0), content (#1)]
4949
├── read rows: 16
50-
├── read size: 1.03 KiB
50+
├── read size: < 1 KiB
5151
├── partitions total: 8
5252
├── partitions scanned: 8
5353
├── pruning stats: [segments: <range pruning: 1 to 1 cost: <slt:ignore>>, blocks: <range pruning: 8 to 8 cost: <slt:ignore>, bloom pruning: 8 to 8 cost: <slt:ignore>>]
@@ -104,7 +104,7 @@ Filter
104104
├── scan id: 0
105105
├── output columns: [id (#0), content (#1)]
106106
├── read rows: 16
107-
├── read size: 1.03 KiB
107+
├── read size: < 1 KiB
108108
├── partitions total: 8
109109
├── partitions scanned: 8
110110
├── pruning stats: [segments: <range pruning: 1 to 1 cost: <slt:ignore>>, blocks: <range pruning: 8 to 8 cost: <slt:ignore>, bloom pruning: 8 to 8 cost: <slt:ignore>>]

tests/sqllogictests/suites/mode/standalone/explain/selectivity/modulo.test

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ AggregateFinal
2323
├── scan id: 0
2424
├── output columns: [number (#0)]
2525
├── read rows: 1000
26-
├── read size: 1.40 KiB
26+
├── read size: 1.41 KiB
2727
├── partitions total: 1
2828
├── partitions scanned: 1
2929
├── pruning stats: [segments: <range pruning: 1 to 1 cost: <slt:ignore>>, blocks: <range pruning: 1 to 1 cost: <slt:ignore>>]
@@ -52,7 +52,7 @@ AggregateFinal
5252
├── scan id: 0
5353
├── output columns: [number (#0)]
5454
├── read rows: 1000
55-
├── read size: 1.40 KiB
55+
├── read size: 1.41 KiB
5656
├── partitions total: 1
5757
├── partitions scanned: 1
5858
├── pruning stats: [segments: <range pruning: 1 to 1 cost: <slt:ignore>>, blocks: <range pruning: 1 to 1 cost: <slt:ignore>>]

0 commit comments

Comments
 (0)