Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
zhyass committed Dec 30, 2024
1 parent 13e2e59 commit 88111a3
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
## Copyright 2023 Databend Cloud
##
## Licensed under the Elastic License, Version 2.0 (the "License");
## you may not use this file except in compliance with the License.
## You may obtain a copy of the License at
##
## https://www.elastic.co/licensing/elastic-license
##
## Unless required by applicable law or agreed to in writing, software
## distributed under the License is distributed on an "AS IS" BASIS,
## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
## See the License for the specific language governing permissions and
## limitations under the License.

statement ok
CREATE OR REPLACE TABLE test_hilbert(a int, b int) cluster by hilbert(a,b) row_per_block = 2;

statement ok
INSERT INTO test_hilbert VALUES(1, 1), (1, 2);

statement ok
INSERT INTO test_hilbert VALUES(2, 1), (2, 2);

statement ok
ALTER TABLE test_hilbert RECLUSTER FINAL;

statement error 4013
select * from clustering_information('default','test_hilbert')

query T
EXPLAIN SELECT * FROM test_hilbert WHERE a = 1;
----
Filter
├── output columns: [test_hilbert.a (#0), test_hilbert.b (#1)]
├── filters: [is_true(test_hilbert.a (#0) = 1)]
├── estimated rows: 2.00
└── TableScan
├── table: default.default.test_hilbert
├── output columns: [a (#0), b (#1)]
├── read rows: 4
├── read size: < 1 KiB
├── partitions total: 2
├── partitions scanned: 2
├── pruning stats: [segments: <range pruning: 1 to 1>, blocks: <range pruning: 2 to 2, bloom pruning: 2 to 2>]
├── push downs: [filters: [is_true(test_hilbert.a (#0) = 1)], limit: NONE]
└── estimated rows: 4.00

query T
EXPLAIN SELECT * FROM test_hilbert WHERE b = 1;
----
Filter
├── output columns: [test_hilbert.a (#0), test_hilbert.b (#1)]
├── filters: [is_true(test_hilbert.b (#1) = 1)]
├── estimated rows: 2.00
└── TableScan
├── table: default.default.test_hilbert
├── output columns: [a (#0), b (#1)]
├── read rows: 2
├── read size: < 1 KiB
├── partitions total: 2
├── partitions scanned: 1
├── pruning stats: [segments: <range pruning: 1 to 1>, blocks: <range pruning: 2 to 1, bloom pruning: 1 to 1>]
├── push downs: [filters: [is_true(test_hilbert.b (#1) = 1)], limit: NONE]
└── estimated rows: 4.00

statement ok
DROP TABLE test_hilbert ALL;
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,6 @@ Filter
├── pruning stats: [segments: <range pruning: 1 to 1>, blocks: <range pruning: 2 to 2, bloom pruning: 2 to 2>]
├── push downs: [filters: [is_true(test_linear.b (#1) = 1)], limit: NONE]
└── estimated rows: 4.00

statement ok
DROP TABLE test_linear ALL;

0 comments on commit 88111a3

Please sign in to comment.