Skip to content

Commit e4f3f31

Browse files
committed
add sql logic test for runtime bloom pruning
1 parent 9b9a789 commit e4f3f31

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
The probe table should consist of 2 blocks
2+
2
3+
runtime range filter should work, one of the blocks should be pruned by range filter
4+
├── parts pruned by runtime range filter: 1
5+
runtime bloom filter should work, another block should be pruned by bloom filter
6+
├── parts pruned by runtime range filter: 1
7+
├── parts pruned by runtime bloom filter: 1
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/usr/bin/env bash
2+
3+
CURDIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
4+
. "$CURDIR"/../../../shell_env.sh
5+
6+
echo "create or replace database rt_bloom" | $BENDSQL_CLIENT_CONNECT
7+
8+
echo "create table rt_bloom.probe(c uint64) as select * from numbers(100000)" | $BENDSQL_CLIENT_CONNECT
9+
echo "create table rt_bloom.build(c uint64)" | $BENDSQL_CLIENT_CONNECT
10+
11+
echo "The probe table should consist of 2 blocks"
12+
echo "select block_count from fuse_snapshot('rt_bloom','probe')" | $BENDSQL_CLIENT_CONNECT
13+
14+
15+
echo "insert into rt_bloom.build values(50)" | $BENDSQL_CLIENT_CONNECT
16+
17+
18+
echo "runtime range filter should work, one of the blocks should be pruned by range filter"
19+
echo "explain analyze select * from rt_bloom.probe inner join rt_bloom.build on probe.c = build.c " \
20+
| $BENDSQL_CLIENT_CONNECT | grep "parts pruned by"
21+
22+
23+
24+
echo "delete from rt_bloom.probe where c = 50" | $BENDSQL_CLIENT_CONNECT;
25+
echo "runtime bloom filter should work, another block should be pruned by bloom filter"
26+
echo "explain analyze select * from rt_bloom.probe inner join rt_bloom.build on probe.c = build.c " \
27+
| $BENDSQL_CLIENT_CONNECT | grep "parts pruned by"
28+
29+
echo "DROP TABLE rt_bloom.probe" | $BENDSQL_CLIENT_CONNECT
30+
echo "DROP TABLE rt_bloom.build" | $BENDSQL_CLIENT_CONNECT
31+
echo "drop database rt_bloom" | $BENDSQL_CLIENT_CONNECT

0 commit comments

Comments
 (0)