From 6b8c7dadb941a39ffe0e6e3f7be2b9b244525a44 Mon Sep 17 00:00:00 2001 From: Nikita Vasilev Date: Thu, 17 Jan 2019 14:10:43 +0300 Subject: [PATCH] fix --- dbms/src/Parsers/ASTCreateQuery.h | 2 +- dbms/src/Parsers/ParserCreateQuery.cpp | 2 +- .../queries/0_stateless/00823_minmax_index.sql | 2 +- .../00823_minmax_index_replicated_zookeeper.sql | 4 ++-- .../0_stateless/00824_indices_alter.reference | 6 +++--- .../queries/0_stateless/00824_indices_alter.sql | 2 +- ..._indices_alter_replicated_zookeeper.reference | 16 ++++++++-------- .../00824_indices_alter_replicated_zookeeper.sql | 4 ++-- 8 files changed, 19 insertions(+), 19 deletions(-) diff --git a/dbms/src/Parsers/ASTCreateQuery.h b/dbms/src/Parsers/ASTCreateQuery.h index 8c1787f9bb4..0fdd27902d6 100644 --- a/dbms/src/Parsers/ASTCreateQuery.h +++ b/dbms/src/Parsers/ASTCreateQuery.h @@ -77,7 +77,7 @@ public: } if (indexes) { - s.ostr << (s.hilite ? hilite_keyword : "") << s.nl_or_ws << "INDEXES " << (s.hilite ? hilite_none : ""); + s.ostr << (s.hilite ? hilite_keyword : "") << s.nl_or_ws << "INDICES " << (s.hilite ? hilite_none : ""); indexes->formatImpl(s, state, frame); } if (settings) diff --git a/dbms/src/Parsers/ParserCreateQuery.cpp b/dbms/src/Parsers/ParserCreateQuery.cpp index 38bc71aab0f..d6eaf00d33c 100644 --- a/dbms/src/Parsers/ParserCreateQuery.cpp +++ b/dbms/src/Parsers/ParserCreateQuery.cpp @@ -154,7 +154,7 @@ bool ParserStorage::parseImpl(Pos & pos, ASTPtr & node, Expected & expected) ParserKeyword s_primary_key("PRIMARY KEY"); ParserKeyword s_order_by("ORDER BY"); ParserKeyword s_sample_by("SAMPLE BY"); - ParserKeyword s_indexes("INDEXES"); + ParserKeyword s_indexes("INDICES"); ParserKeyword s_settings("SETTINGS"); ParserIdentifierWithOptionalParameters ident_with_optional_params_p; diff --git a/dbms/tests/queries/0_stateless/00823_minmax_index.sql b/dbms/tests/queries/0_stateless/00823_minmax_index.sql index a1ca97f3a7b..00d89fcfcd9 100644 --- a/dbms/tests/queries/0_stateless/00823_minmax_index.sql +++ b/dbms/tests/queries/0_stateless/00823_minmax_index.sql @@ -11,7 +11,7 @@ CREATE TABLE test.minmax_idx dt Date ) ENGINE = MergeTree() ORDER BY u64 -INDEXES idx_all BY (i32, i32 + f64, d, s, e, dt) TYPE minmax GRANULARITY 2, +INDICES idx_all BY (i32, i32 + f64, d, s, e, dt) TYPE minmax GRANULARITY 2, idx_2 BY (u64 + toYear(dt), substring(s, 2, 4)) TYPE minmax GRANULARITY 3 SETTINGS index_granularity = 2; diff --git a/dbms/tests/queries/0_stateless/00823_minmax_index_replicated_zookeeper.sql b/dbms/tests/queries/0_stateless/00823_minmax_index_replicated_zookeeper.sql index 32d5a776aca..d264d769874 100644 --- a/dbms/tests/queries/0_stateless/00823_minmax_index_replicated_zookeeper.sql +++ b/dbms/tests/queries/0_stateless/00823_minmax_index_replicated_zookeeper.sql @@ -12,7 +12,7 @@ CREATE TABLE test.minmax_idx1 dt Date ) ENGINE = ReplicatedMergeTree('/clickhouse/tables/test/minmax', 'r1') ORDER BY u64 -INDEXES idx_all BY (i32, i32 + f64, d, s, e, dt) TYPE minmax GRANULARITY 2, +INDICES idx_all BY (i32, i32 + f64, d, s, e, dt) TYPE minmax GRANULARITY 2, idx_2 BY (u64 + toYear(dt), substring(s, 2, 4)) TYPE minmax GRANULARITY 3 SETTINGS index_granularity = 2; @@ -27,7 +27,7 @@ CREATE TABLE test.minmax_idx2 dt Date ) ENGINE = ReplicatedMergeTree('/clickhouse/tables/test/minmax', 'r2') ORDER BY u64 -INDEXES idx_all BY (i32, i32 + f64, d, s, e, dt) TYPE minmax GRANULARITY 2, +INDICES idx_all BY (i32, i32 + f64, d, s, e, dt) TYPE minmax GRANULARITY 2, idx_2 BY (u64 + toYear(dt), substring(s, 2, 4)) TYPE minmax GRANULARITY 3 SETTINGS index_granularity = 2; diff --git a/dbms/tests/queries/0_stateless/00824_indices_alter.reference b/dbms/tests/queries/0_stateless/00824_indices_alter.reference index 30968fbe9de..275413608bb 100644 --- a/dbms/tests/queries/0_stateless/00824_indices_alter.reference +++ b/dbms/tests/queries/0_stateless/00824_indices_alter.reference @@ -1,4 +1,4 @@ -CREATE TABLE test.minmax_idx ( u64 UInt64, i32 Int32) ENGINE = MergeTree() ORDER BY u64 INDEXES idx1 BY u64 * i32 TYPE minmax GRANULARITY 10, idx3 BY u64 - i32 TYPE minmax GRANULARITY 10, idx2 BY u64 + i32 TYPE minmax GRANULARITY 10 SETTINGS index_granularity = 8192 +CREATE TABLE test.minmax_idx ( u64 UInt64, i32 Int32) ENGINE = MergeTree() ORDER BY u64 INDICES idx1 BY u64 * i32 TYPE minmax GRANULARITY 10, idx3 BY u64 - i32 TYPE minmax GRANULARITY 10, idx2 BY u64 + i32 TYPE minmax GRANULARITY 10 SETTINGS index_granularity = 8192 1 2 1 2 1 2 @@ -6,7 +6,7 @@ CREATE TABLE test.minmax_idx ( u64 UInt64, i32 Int32) ENGINE = MergeTree() ORDE 1 2 1 2 1 2 -CREATE TABLE test.minmax_idx ( u64 UInt64, i32 Int32) ENGINE = MergeTree() ORDER BY u64 INDEXES idx3 BY u64 - i32 TYPE minmax GRANULARITY 10, idx2 BY u64 + i32 TYPE minmax GRANULARITY 10 SETTINGS index_granularity = 8192 +CREATE TABLE test.minmax_idx ( u64 UInt64, i32 Int32) ENGINE = MergeTree() ORDER BY u64 INDICES idx3 BY u64 - i32 TYPE minmax GRANULARITY 10, idx2 BY u64 + i32 TYPE minmax GRANULARITY 10 SETTINGS index_granularity = 8192 1 2 1 2 1 2 @@ -14,7 +14,7 @@ CREATE TABLE test.minmax_idx ( u64 UInt64, i32 Int32) ENGINE = MergeTree() ORDE 1 2 1 2 CREATE TABLE test.minmax_idx ( u64 UInt64, i32 Int32) ENGINE = MergeTree() ORDER BY u64 SETTINGS index_granularity = 8192 -CREATE TABLE test.minmax_idx ( u64 UInt64, i32 Int32) ENGINE = MergeTree() ORDER BY u64 INDEXES idx1 BY u64 * i32 TYPE minmax GRANULARITY 10 SETTINGS index_granularity = 8192 +CREATE TABLE test.minmax_idx ( u64 UInt64, i32 Int32) ENGINE = MergeTree() ORDER BY u64 INDICES idx1 BY u64 * i32 TYPE minmax GRANULARITY 10 SETTINGS index_granularity = 8192 1 2 1 2 1 2 diff --git a/dbms/tests/queries/0_stateless/00824_indices_alter.sql b/dbms/tests/queries/0_stateless/00824_indices_alter.sql index 1963ae3afcd..f345d923351 100644 --- a/dbms/tests/queries/0_stateless/00824_indices_alter.sql +++ b/dbms/tests/queries/0_stateless/00824_indices_alter.sql @@ -50,7 +50,7 @@ CREATE TABLE test.minmax_idx2 i32 Int32 ) ENGINE = MergeTree() ORDER BY u64 -INDEXES idx1 BY u64 + i32 TYPE minmax GRANULARITY 10, +INDICES idx1 BY u64 + i32 TYPE minmax GRANULARITY 10, idx2 BY u64 * i32 TYPE minmax GRANULARITY 10; INSERT INTO test.minmax_idx2 VALUES (1, 2); diff --git a/dbms/tests/queries/0_stateless/00824_indices_alter_replicated_zookeeper.reference b/dbms/tests/queries/0_stateless/00824_indices_alter_replicated_zookeeper.reference index 6d97145c07f..a56117e915b 100644 --- a/dbms/tests/queries/0_stateless/00824_indices_alter_replicated_zookeeper.reference +++ b/dbms/tests/queries/0_stateless/00824_indices_alter_replicated_zookeeper.reference @@ -1,5 +1,5 @@ -CREATE TABLE test.minmax_idx ( u64 UInt64, i32 Int32) ENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/indices_alter1\', \'r1\') ORDER BY u64 INDEXES idx1 BY u64 * i32 TYPE minmax GRANULARITY 10, idx3 BY u64 - i32 TYPE minmax GRANULARITY 10, idx2 BY u64 + i32 TYPE minmax GRANULARITY 10 SETTINGS index_granularity = 8192 -CREATE TABLE test.minmax_idx_r ( u64 UInt64, i32 Int32) ENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/indices_alter1\', \'r2\') ORDER BY u64 INDEXES idx1 BY u64 * i32 TYPE minmax GRANULARITY 10, idx3 BY u64 - i32 TYPE minmax GRANULARITY 10, idx2 BY u64 + i32 TYPE minmax GRANULARITY 10 SETTINGS index_granularity = 8192 +CREATE TABLE test.minmax_idx ( u64 UInt64, i32 Int32) ENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/indices_alter1\', \'r1\') ORDER BY u64 INDICES idx1 BY u64 * i32 TYPE minmax GRANULARITY 10, idx3 BY u64 - i32 TYPE minmax GRANULARITY 10, idx2 BY u64 + i32 TYPE minmax GRANULARITY 10 SETTINGS index_granularity = 8192 +CREATE TABLE test.minmax_idx_r ( u64 UInt64, i32 Int32) ENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/indices_alter1\', \'r2\') ORDER BY u64 INDICES idx1 BY u64 * i32 TYPE minmax GRANULARITY 10, idx3 BY u64 - i32 TYPE minmax GRANULARITY 10, idx2 BY u64 + i32 TYPE minmax GRANULARITY 10 SETTINGS index_granularity = 8192 1 2 1 2 1 2 @@ -14,8 +14,8 @@ CREATE TABLE test.minmax_idx_r ( u64 UInt64, i32 Int32) ENGINE = ReplicatedMerg 3 2 19 9 65 75 -CREATE TABLE test.minmax_idx ( u64 UInt64, i32 Int32) ENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/indices_alter1\', \'r1\') ORDER BY u64 INDEXES idx3 BY u64 - i32 TYPE minmax GRANULARITY 10, idx2 BY u64 + i32 TYPE minmax GRANULARITY 10 SETTINGS index_granularity = 8192 -CREATE TABLE test.minmax_idx_r ( u64 UInt64, i32 Int32) ENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/indices_alter1\', \'r2\') ORDER BY u64 INDEXES idx3 BY u64 - i32 TYPE minmax GRANULARITY 10, idx2 BY u64 + i32 TYPE minmax GRANULARITY 10 SETTINGS index_granularity = 8192 +CREATE TABLE test.minmax_idx ( u64 UInt64, i32 Int32) ENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/indices_alter1\', \'r1\') ORDER BY u64 INDICES idx3 BY u64 - i32 TYPE minmax GRANULARITY 10, idx2 BY u64 + i32 TYPE minmax GRANULARITY 10 SETTINGS index_granularity = 8192 +CREATE TABLE test.minmax_idx_r ( u64 UInt64, i32 Int32) ENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/indices_alter1\', \'r2\') ORDER BY u64 INDICES idx3 BY u64 - i32 TYPE minmax GRANULARITY 10, idx2 BY u64 + i32 TYPE minmax GRANULARITY 10 SETTINGS index_granularity = 8192 1 2 1 4 1 5 @@ -30,8 +30,8 @@ CREATE TABLE test.minmax_idx_r ( u64 UInt64, i32 Int32) ENGINE = ReplicatedMerg 65 75 CREATE TABLE test.minmax_idx ( u64 UInt64, i32 Int32) ENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/indices_alter1\', \'r1\') ORDER BY u64 SETTINGS index_granularity = 8192 CREATE TABLE test.minmax_idx_r ( u64 UInt64, i32 Int32) ENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/indices_alter1\', \'r2\') ORDER BY u64 SETTINGS index_granularity = 8192 -CREATE TABLE test.minmax_idx ( u64 UInt64, i32 Int32) ENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/indices_alter1\', \'r1\') ORDER BY u64 INDEXES idx1 BY u64 * i32 TYPE minmax GRANULARITY 10 SETTINGS index_granularity = 8192 -CREATE TABLE test.minmax_idx_r ( u64 UInt64, i32 Int32) ENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/indices_alter1\', \'r2\') ORDER BY u64 INDEXES idx1 BY u64 * i32 TYPE minmax GRANULARITY 10 SETTINGS index_granularity = 8192 +CREATE TABLE test.minmax_idx ( u64 UInt64, i32 Int32) ENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/indices_alter1\', \'r1\') ORDER BY u64 INDICES idx1 BY u64 * i32 TYPE minmax GRANULARITY 10 SETTINGS index_granularity = 8192 +CREATE TABLE test.minmax_idx_r ( u64 UInt64, i32 Int32) ENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/indices_alter1\', \'r2\') ORDER BY u64 INDICES idx1 BY u64 * i32 TYPE minmax GRANULARITY 10 SETTINGS index_granularity = 8192 1 2 1 4 1 5 @@ -44,8 +44,8 @@ CREATE TABLE test.minmax_idx_r ( u64 UInt64, i32 Int32) ENGINE = ReplicatedMerg 3 2 19 9 65 75 -CREATE TABLE test.minmax_idx2 ( u64 UInt64, i32 Int32) ENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/indices_alter2\', \'r1\') ORDER BY u64 INDEXES idx1 BY u64 + i32 TYPE minmax GRANULARITY 10, idx2 BY u64 * i32 TYPE minmax GRANULARITY 10 SETTINGS index_granularity = 8192 -CREATE TABLE test.minmax_idx2_r ( u64 UInt64, i32 Int32) ENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/indices_alter2\', \'r2\') ORDER BY u64 INDEXES idx1 BY u64 + i32 TYPE minmax GRANULARITY 10, idx2 BY u64 * i32 TYPE minmax GRANULARITY 10 SETTINGS index_granularity = 8192 +CREATE TABLE test.minmax_idx2 ( u64 UInt64, i32 Int32) ENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/indices_alter2\', \'r1\') ORDER BY u64 INDICES idx1 BY u64 + i32 TYPE minmax GRANULARITY 10, idx2 BY u64 * i32 TYPE minmax GRANULARITY 10 SETTINGS index_granularity = 8192 +CREATE TABLE test.minmax_idx2_r ( u64 UInt64, i32 Int32) ENGINE = ReplicatedMergeTree(\'/clickhouse/tables/test/indices_alter2\', \'r2\') ORDER BY u64 INDICES idx1 BY u64 + i32 TYPE minmax GRANULARITY 10, idx2 BY u64 * i32 TYPE minmax GRANULARITY 10 SETTINGS index_granularity = 8192 1 2 1 3 1 2 diff --git a/dbms/tests/queries/0_stateless/00824_indices_alter_replicated_zookeeper.sql b/dbms/tests/queries/0_stateless/00824_indices_alter_replicated_zookeeper.sql index 0a452cdf755..0b4a524464f 100644 --- a/dbms/tests/queries/0_stateless/00824_indices_alter_replicated_zookeeper.sql +++ b/dbms/tests/queries/0_stateless/00824_indices_alter_replicated_zookeeper.sql @@ -72,7 +72,7 @@ CREATE TABLE test.minmax_idx2 i32 Int32 ) ENGINE = ReplicatedMergeTree('/clickhouse/tables/test/indices_alter2', 'r1') ORDER BY u64 -INDEXES idx1 BY u64 + i32 TYPE minmax GRANULARITY 10, +INDICES idx1 BY u64 + i32 TYPE minmax GRANULARITY 10, idx2 BY u64 * i32 TYPE minmax GRANULARITY 10; CREATE TABLE test.minmax_idx2_r @@ -81,7 +81,7 @@ CREATE TABLE test.minmax_idx2_r i32 Int32 ) ENGINE = ReplicatedMergeTree('/clickhouse/tables/test/indices_alter2', 'r2') ORDER BY u64 -INDEXES idx1 BY u64 + i32 TYPE minmax GRANULARITY 10, +INDICES idx1 BY u64 + i32 TYPE minmax GRANULARITY 10, idx2 BY u64 * i32 TYPE minmax GRANULARITY 10;