This commit is contained in:
Dmitry Rubashkin 2019-08-07 15:14:45 +03:00
parent 7f26e09160
commit 93d385f813
2 changed files with 29 additions and 0 deletions

View File

@ -0,0 +1,6 @@
7777
7777
7777
7777
7777.000
7777.000

View File

@ -0,0 +1,23 @@
DROP TABLE IF EXISTS test1;
DROP TABLE IF EXISTS test2;
DROP TABLE IF EXISTS test3;
CREATE TABLE test1 (n UInt64) ENGINE = MergeTree ORDER BY n SETTINGS index_granularity = 1;
CREATE TABLE test2 (s String) ENGINE = MergeTree ORDER BY s SETTINGS index_granularity = 1;
CREATE TABLE test3 (d Decimal(4, 3)) ENGINE = MergeTree ORDER BY d SETTINGS index_granularity = 1;
INSERT INTO test1 SELECT * FROM numbers(10000);
SELECT n FROM test1 WHERE toFloat64(n) = 7777.0 SETTINGS max_rows_to_read = 2;
SELECT n FROM test1 WHERE toFloat32(n) = 7777.0 SETTINGS max_rows_to_read = 2;
INSERT INTO test2 SELECT toString(number) FROM numbers(10000);
SELECT s FROM test2 WHERE toFloat64(s) = 7777.0;
SELECT s FROM test2 WHERE toFloat32(s) = 7777.0;
INSERT INTO test3 SELECT toDecimal64(number, 3) FROM numbers(10000);
SELECT d FROM test3 WHERE toFloat64(d) = 7777.0 SETTINGS max_rows_to_read = 2;
SELECT d FROM test3 WHERE toFloat32(d) = 7777.0 SETTINGS max_rows_to_read = 2;
DROP TABLE test1;
DROP TABLE test2;
DROP TABLE test3;