Skip to content

Commit

Permalink
Merge pull request databendlabs#6736 from dantengsky/fix-stateless-te…
Browse files Browse the repository at this point in the history
…st-case-for-pr-6731

chore: add stateless test case for pr databendlabs#6731
  • Loading branch information
BohuTANG authored Jul 21, 2022
2 parents 9b33da8 + d207ff2 commit 2fd6e89
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
-- insert 3 blocks
-- check pruning, by col c1
Projection: c1:Int32, c2:String
Filter: (c1 = 1)
ReadDataSource: scan schema: [c1:Int32, c2:String], statistics: [read_rows: 1, read_bytes: 55, partitions_scanned: 1, partitions_total: 3], push_downs: [projections: [0, 1], filters: [(c1 = 1)]]
-- check pruning, by col c2
Projection: c1:Int32, c2:String
Filter: (c2 > b)
ReadDataSource: scan schema: [c1:Int32, c2:String], statistics: [read_rows: 1, read_bytes: 55, partitions_scanned: 1, partitions_total: 3], push_downs: [projections: [0, 1], filters: [(c2 > b)]]
21 changes: 21 additions & 0 deletions tests/suites/0_stateless/09_fuse_engine/09_0018_min_max_index.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
DROP DATABASE IF EXISTS db_09_18;

CREATE DATABASE db_09_18;

USE db_09_18;

CREATE TABLE t(c1 int, c2 string);

select '-- insert 3 blocks';
INSERT INTO t VALUES(1, "a");
INSERT INTO t VALUES(2, "b");
INSERT INTO t VALUES(3, "c");

select '-- check pruning, by col c1 ';
explain select * from t where c1 = 1;

select '-- check pruning, by col c2 ';
explain select * from t where c2 > 'b';

DROP TABLE t;
DROP DATABASE db_09_18;
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
-- insert 3 blocks
-- check pruning, by col c1
Projection: c1:Int32, c2:String
Filter: (c1 = 1)
ReadDataSource: scan schema: [c1:Int32, c2:String], statistics: [read_rows: 1, read_bytes: 55, partitions_scanned: 1, partitions_total: 3], push_downs: [projections: [0, 1], filters: [(c1 = 1)]]
-- check pruning, by col c2
Projection: c1:Int32, c2:String
Filter: (c2 > b)
ReadDataSource: scan schema: [c1:Int32, c2:String], statistics: [read_rows: 1, read_bytes: 55, partitions_scanned: 1, partitions_total: 3], push_downs: [projections: [0, 1], filters: [(c2 > b)]]

0 comments on commit 2fd6e89

Please sign in to comment.