mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-25 17:12:03 +00:00
Merge pull request #18306 from amosbird/restrictsettings
Extend mergetree setting alter restriction
This commit is contained in:
commit
f3f5466d23
@ -134,7 +134,8 @@ struct MergeTreeSettings : public BaseSettings<MergeTreeSettingsTraits>
|
||||
/// We check settings after storage creation
|
||||
static bool isReadonlySetting(const String & name)
|
||||
{
|
||||
return name == "index_granularity" || name == "index_granularity_bytes";
|
||||
return name == "index_granularity" || name == "index_granularity_bytes" || name == "write_final_mark"
|
||||
|| name == "enable_mixed_granularity_parts";
|
||||
}
|
||||
|
||||
static bool isPartFormatSetting(const String & name)
|
||||
|
@ -51,31 +51,3 @@ def test_attach_detach(start_cluster):
|
||||
|
||||
assert node1.query("SELECT COUNT() FROM test") == "4\n"
|
||||
assert node2.query("SELECT COUNT() FROM test") == "4\n"
|
||||
|
||||
|
||||
def test_mutate_with_mixed_granularity(start_cluster):
|
||||
node3.query("""
|
||||
CREATE TABLE test (date Date, key UInt64, value1 String, value2 String)
|
||||
ENGINE = MergeTree
|
||||
ORDER BY key PARTITION BY date""")
|
||||
|
||||
node3.query(
|
||||
"INSERT INTO test SELECT toDate('2019-10-01') + number % 5, number, toString(number), toString(number * number) FROM numbers(500)")
|
||||
|
||||
assert node3.query("SELECT COUNT() FROM test") == "500\n"
|
||||
|
||||
node3.restart_with_latest_version()
|
||||
|
||||
assert node3.query("SELECT COUNT() FROM test") == "500\n"
|
||||
|
||||
node3.query("ALTER TABLE test MODIFY SETTING enable_mixed_granularity_parts = 1")
|
||||
|
||||
node3.query(
|
||||
"INSERT INTO test SELECT toDate('2019-10-01') + number % 5, number, toString(number), toString(number * number) FROM numbers(500, 500)")
|
||||
|
||||
assert node3.query("SELECT COUNT() FROM test") == "1000\n"
|
||||
assert node3.query("SELECT COUNT() FROM test WHERE key % 100 == 0") == "10\n"
|
||||
|
||||
node3.query("ALTER TABLE test DELETE WHERE key % 100 == 0", settings={"mutations_sync": "2"})
|
||||
|
||||
assert node3.query("SELECT COUNT() FROM test WHERE key % 100 == 0") == "0\n"
|
||||
|
Loading…
Reference in New Issue
Block a user