Add additional tests

This commit is contained in:
Joshua Hildred 2024-06-05 06:57:02 -07:00
parent e495bf0742
commit 095508edb7
3 changed files with 53 additions and 3 deletions

View File

@ -47,7 +47,7 @@ ASTPtr getCustomKeyFilterForParallelReplica(
using RelativeSize = boost::rational<ASTSampleRatio::BigNum>;
RelativeSize range_upper = 0;
RelativeSize range_upper = RelativeSize(0);
RelativeSize range_lower = RelativeSize(filter.range_lower);
DataTypePtr custom_key_column_type = custom_key_description.data_types[0];

View File

@ -1,6 +1,6 @@
DROP TABLE IF EXISTS range_filter_custom_range_test;
CREATE TABLE range_filter_custom_range_test (k Int64) ENGINE=MergeTree ORDER BY k;
CREATE TABLE range_filter_custom_range_test (k UInt64) ENGINE=MergeTree ORDER BY k;
INSERT INTO range_filter_custom_range_test SELECT number + 5 from numbers(10);
@ -75,4 +75,51 @@ FROM
parallel_replicas_custom_key_range_lower = 500, parallel_replicas_custom_key_range_upper = 10000
);
DROP TABLE range_filter_custom_range_test;
SELECT count()
FROM
(
SELECT *
FROM cluster(test_cluster_one_shard_three_replicas_localhost, currentDatabase(), range_filter_custom_range_test)
SETTINGS prefer_localhost_replica = 0, max_parallel_replicas = 3, distributed_group_by_no_merge = 0,
parallel_replicas_custom_key = 'k', parallel_replicas_custom_key_filter_type = 'range',
parallel_replicas_custom_key_range_lower = 10, parallel_replicas_custom_key_range_upper = 13
);
DROP TABLE range_filter_custom_range_test;
DROP TABLE IF EXISTS range_filter_custom_range_test_2;
CREATE TABLE range_filter_custom_range_test_2 (k UInt64) ENGINE=MergeTree ORDER BY k;
INSERT INTO range_filter_custom_range_test_2 SELECT number from numbers(13);
SELECT count()
FROM
(
SELECT *
FROM cluster(parallel_replicas, currentDatabase(), range_filter_custom_range_test_2)
SETTINGS prefer_localhost_replica = 0, max_parallel_replicas = 12, distributed_group_by_no_merge = 0,
parallel_replicas_custom_key = 'k', parallel_replicas_custom_key_filter_type = 'range',
parallel_replicas_custom_key_range_lower = 0, parallel_replicas_custom_key_range_upper = 13
);
DROP TABLE range_filter_custom_range_test_2;
DROP TABLE IF EXISTS range_filter_custom_range_test_3;
CREATE TABLE range_filter_custom_range_test_3 (k UInt64) ENGINE=MergeTree ORDER BY k;
INSERT INTO range_filter_custom_range_test_3 SELECT number from numbers(4);
SELECT count()
FROM
(
SELECT *
FROM cluster(test_cluster_one_shard_three_replicas_localhost, currentDatabase(), range_filter_custom_range_test_3)
SETTINGS prefer_localhost_replica = 0, max_parallel_replicas = 12, distributed_group_by_no_merge = 0,
parallel_replicas_custom_key = 'k', parallel_replicas_custom_key_filter_type = 'range',
parallel_replicas_custom_key_range_lower = 0, parallel_replicas_custom_key_range_upper = 4
);
DROP TABLE range_filter_custom_range_test_3;