diff --git a/tests/integration/test_sharding_key_from_default_column/test.py b/tests/integration/test_sharding_key_from_default_column/test.py index 1ecf96305a4..5bce3ee4169 100644 --- a/tests/integration/test_sharding_key_from_default_column/test.py +++ b/tests/integration/test_sharding_key_from_default_column/test.py @@ -49,14 +49,14 @@ def test_default_column(): "INSERT INTO TABLE dist (x) VALUES (1), (2), (3), (4)", settings=settings ) node1.query("SYSTEM FLUSH DISTRIBUTED dist") - assert node1.query("SELECT x, y, z FROM local") == TSV( + assert node1.query("SELECT x, y, z FROM local ORDER BY x") == TSV( [[2, 102, 104], [4, 104, 108]] ) - assert node2.query("SELECT x, y, z FROM local") == TSV( + assert node2.query("SELECT x, y, z FROM local ORDER BY x") == TSV( [[1, 101, 102], [3, 103, 106]] ) - assert node1.query("SELECT x, y, z FROM dist") == TSV( - [[2, 102, 104], [4, 104, 108], [1, 101, 102], [3, 103, 106]] + assert node1.query("SELECT x, y, z FROM dist ORDER BY x") == TSV( + [[1, 101, 102], [2, 102, 104], [3, 103, 106], [4, 104, 108]] ) # INSERT INTO TABLE dist (x, y) @@ -66,12 +66,12 @@ def test_default_column(): settings=settings, ) node1.query("SYSTEM FLUSH DISTRIBUTED dist") - assert node1.query("SELECT x, y, z FROM local") == TSV([[2, 22, 24]]) - assert node2.query("SELECT x, y, z FROM local") == TSV( + assert node1.query("SELECT x, y, z FROM local ORDER BY x") == TSV([[2, 22, 24]]) + assert node2.query("SELECT x, y, z FROM local ORDER BY x") == TSV( [[1, 11, 12], [3, 33, 36]] ) - assert node1.query("SELECT x, y, z FROM dist") == TSV( - [[2, 22, 24], [1, 11, 12], [3, 33, 36]] + assert node1.query("SELECT x, y, z FROM dist ORDER BY x") == TSV( + [[1, 11, 12], [2, 22, 24], [3, 33, 36]] ) @@ -96,14 +96,14 @@ def test_materialized_column_allow_insert_materialized(): "INSERT INTO TABLE dist (x) VALUES (1), (2), (3), (4)", settings=settings ) node1.query("SYSTEM FLUSH DISTRIBUTED dist") - assert node1.query("SELECT x, y, z FROM local") == TSV( + assert node1.query("SELECT x, y, z FROM local ORDER BY x") == TSV( [[2, 102, 104], [4, 104, 108]] ) - assert node2.query("SELECT x, y, z FROM local") == TSV( + assert node2.query("SELECT x, y, z FROM local ORDER BY x") == TSV( [[1, 101, 102], [3, 103, 106]] ) - assert node1.query("SELECT x, y, z FROM dist") == TSV( - [[2, 102, 104], [4, 104, 108], [1, 101, 102], [3, 103, 106]] + assert node1.query("SELECT x, y, z FROM dist ORDER BY x") == TSV( + [[1, 101, 102], [2, 102, 104], [3, 103, 106], [4, 104, 108]] ) # INSERT INTO TABLE dist (x, y) @@ -113,12 +113,12 @@ def test_materialized_column_allow_insert_materialized(): settings=settings, ) node1.query("SYSTEM FLUSH DISTRIBUTED dist") - assert node1.query("SELECT x, y, z FROM local") == TSV([[2, 22, 24]]) - assert node2.query("SELECT x, y, z FROM local") == TSV( + assert node1.query("SELECT x, y, z FROM local ORDER BY x") == TSV([[2, 22, 24]]) + assert node2.query("SELECT x, y, z FROM local ORDER BY x") == TSV( [[1, 11, 12], [3, 33, 36]] ) - assert node1.query("SELECT x, y, z FROM dist") == TSV( - [[2, 22, 24], [1, 11, 12], [3, 33, 36]] + assert node1.query("SELECT x, y, z FROM dist ORDER BY x") == TSV( + [[1, 11, 12], [2, 22, 24], [3, 33, 36]] ) @@ -143,14 +143,14 @@ def test_materialized_column_disallow_insert_materialized(): "INSERT INTO TABLE dist (x) VALUES (1), (2), (3), (4)", settings=settings ) node1.query("SYSTEM FLUSH DISTRIBUTED dist") - assert node1.query("SELECT x, y, z FROM local") == TSV( + assert node1.query("SELECT x, y, z FROM local ORDER BY x") == TSV( [[2, 202, -200], [4, 204, -200]] ) - assert node2.query("SELECT x, y, z FROM local") == TSV( + assert node2.query("SELECT x, y, z FROM local ORDER BY x") == TSV( [[1, 201, -200], [3, 203, -200]] ) - assert node1.query("SELECT x, y, z FROM dist") == TSV( - [[2, 202, -200], [4, 204, -200], [1, 201, -200], [3, 203, -200]] + assert node1.query("SELECT x, y, z FROM dist ORDER BY x") == TSV( + [[1, 201, -200], [2, 202, -200], [3, 203, -200], [4, 204, -200]] ) # INSERT INTO TABLE dist (x, y) @@ -183,12 +183,12 @@ def test_materialized_column_disallow_insert_materialized_different_shards(): "INSERT INTO TABLE dist (x) VALUES (1), (2), (3), (4)", settings=settings ) node1.query("SYSTEM FLUSH DISTRIBUTED dist") - assert node1.query("SELECT x, y, z FROM local") == TSV( + assert node1.query("SELECT x, y, z FROM local ORDER BY x") == TSV( [[1, 201, -200], [3, 203, -200]] ) - assert node2.query("SELECT x, y, z FROM local") == TSV( + assert node2.query("SELECT x, y, z FROM local ORDER BY x") == TSV( [[2, 202, -200], [4, 204, -200]] ) - assert node1.query("SELECT x, y, z FROM dist") == TSV( - [[1, 201, -200], [3, 203, -200], [2, 202, -200], [4, 204, -200]] + assert node1.query("SELECT x, y, z FROM dist ORDER BY x") == TSV( + [[1, 201, -200], [2, 202, -200], [3, 203, -200], [4, 204, -200]] )