This commit is contained in:
Nikita Vasilev 2019-01-17 14:10:43 +03:00
parent 8d47872436
commit 6b8c7dadb9
8 changed files with 19 additions and 19 deletions

View File

@ -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)

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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

View File

@ -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);

View File

@ -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

View File

@ -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;