Automatic style fix

This commit is contained in:
robot-clickhouse 2022-09-27 09:53:26 +00:00
parent 4d2a5d752d
commit 08af2a32bf

View File

@ -5,6 +5,7 @@ from helpers.cluster import ClickHouseCluster
cluster = ClickHouseCluster(__file__) cluster = ClickHouseCluster(__file__)
node = cluster.add_instance("node", stay_alive=True) node = cluster.add_instance("node", stay_alive=True)
@pytest.fixture(scope="module", autouse=True) @pytest.fixture(scope="module", autouse=True)
def started_cluster(): def started_cluster():
try: try:
@ -16,23 +17,42 @@ def started_cluster():
def test_compressed_marks_restart_compact(): def test_compressed_marks_restart_compact():
node.query("create table test_02381_compact (a UInt64, b String) ENGINE = MergeTree order by (a, b)") node.query(
"create table test_02381_compact (a UInt64, b String) ENGINE = MergeTree order by (a, b)"
)
node.query("insert into test_02381_compact values (1, 'Hello')") node.query("insert into test_02381_compact values (1, 'Hello')")
node.query("alter table test_02381_compact modify setting compress_marks=true, compress_primary_key=true") node.query(
"alter table test_02381_compact modify setting compress_marks=true, compress_primary_key=true"
)
node.query("insert into test_02381_compact values (2, 'World')") node.query("insert into test_02381_compact values (2, 'World')")
node.query("optimize table test_02381_compact final") node.query("optimize table test_02381_compact final")
assert node.query("SELECT count() FROM test_02381_compact WHERE not ignore(*)") == "2\n" assert (
node.query("SELECT count() FROM test_02381_compact WHERE not ignore(*)")
== "2\n"
)
node.restart_clickhouse() node.restart_clickhouse()
assert node.query("SELECT count() FROM test_02381_compact WHERE not ignore(*)") == "2\n" assert (
node.query("SELECT count() FROM test_02381_compact WHERE not ignore(*)")
== "2\n"
)
def test_compressed_marks_restart_wide(): def test_compressed_marks_restart_wide():
node.query("create table test_02381_wide (a UInt64, b String) ENGINE = MergeTree order by (a, b) SETTINGS min_bytes_for_wide_part=0") node.query(
"create table test_02381_wide (a UInt64, b String) ENGINE = MergeTree order by (a, b) SETTINGS min_bytes_for_wide_part=0"
)
node.query("insert into test_02381_wide values (1, 'Hello')") node.query("insert into test_02381_wide values (1, 'Hello')")
node.query("alter table test_02381_wide modify setting compress_marks=true, compress_primary_key=true") node.query(
"alter table test_02381_wide modify setting compress_marks=true, compress_primary_key=true"
)
node.query("insert into test_02381_wide values (2, 'World')") node.query("insert into test_02381_wide values (2, 'World')")
node.query("optimize table test_02381_wide final") node.query("optimize table test_02381_wide final")
assert node.query("SELECT count() FROM test_02381_wide WHERE not ignore(*)") == "2\n" assert (
node.query("SELECT count() FROM test_02381_wide WHERE not ignore(*)") == "2\n"
)
node.restart_clickhouse() node.restart_clickhouse()
assert node.query("SELECT count() FROM test_02381_wide WHERE not ignore(*)") == "2\n" assert (
node.query("SELECT count() FROM test_02381_wide WHERE not ignore(*)") == "2\n"
)