-
Notifications
You must be signed in to change notification settings - Fork 471
update mzcompose to support 2000 object search #32478
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
ptravers
wants to merge
1
commit into
MaterializeInc:main
Choose a base branch
from
ptravers:pt/9187-mzcompose
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,7 +32,7 @@ | |
from materialize.mzcompose.services.materialized import Materialized | ||
from materialize.mzcompose.services.mysql import MySql | ||
from materialize.mzcompose.services.mz import Mz | ||
from materialize.mzcompose.services.postgres import Postgres | ||
from materialize.mzcompose.services.postgres import Postgres, PostgresMetadata | ||
from materialize.mzcompose.services.schema_registry import SchemaRegistry | ||
from materialize.mzcompose.services.test_certs import TestCerts | ||
from materialize.mzcompose.services.testdrive import Testdrive | ||
|
@@ -74,6 +74,7 @@ class Generator: | |
# For tests that deal with records, the number of records processed | ||
# is usually COUNT * 1000 | ||
COUNT: int = 1000 | ||
MAX_COUNT: int = 2000 | ||
|
||
VERSION: str = "1.0.0" | ||
|
||
|
@@ -131,7 +132,7 @@ def body(cls) -> None: | |
# three extra connections for mz_system, default connection, and one | ||
# since sqlparse 0.4.4. 3 reserved superuser connections since materialize#25666 | ||
# try bumping limit a bit further since this is sometimes flaky | ||
print(f"ALTER SYSTEM SET max_connections = {Connections.COUNT+10};") | ||
print(f"ALTER SYSTEM SET max_connections = {Connections.COUNT + 10};") | ||
|
||
for i in cls.all(): | ||
print( | ||
|
@@ -328,7 +329,7 @@ def body(cls) -> None: | |
'$ set value-schema={"type": "record", "name": "r", "fields": [{"name": "f1", "type": "string"}]}' | ||
) | ||
print( | ||
f"$ kafka-create-topic topic=kafka-partitions partitions={round(cls.COUNT/2)}" | ||
f"$ kafka-create-topic topic=kafka-partitions partitions={round(cls.COUNT / 2)}" | ||
) | ||
print( | ||
"$ kafka-ingest format=avro topic=kafka-partitions key-format=avro key-schema=${key-schema} schema=${value-schema} partition=-1" | ||
|
@@ -668,7 +669,7 @@ def body(cls) -> None: | |
print("> CREATE TABLE t1 (f1 INTEGER);") | ||
print("> INSERT INTO t1 VALUES (1);") | ||
table_list = ", ".join(f"t1 as a{i}" for i in cls.all()) | ||
condition_list = " AND ".join(f"a{i}.f1 = a{i+1}.f1" for i in cls.no_last()) | ||
condition_list = " AND ".join(f"a{i}.f1 = a{i + 1}.f1" for i in cls.no_last()) | ||
cls.store_explain_and_run(f"SELECT * FROM {table_list} WHERE {condition_list};") | ||
print(" ".join("1" for i in cls.all())) | ||
|
||
|
@@ -708,7 +709,7 @@ def body(cls) -> None: | |
print("> CREATE TABLE t1 (f1 INTEGER);") | ||
print("> INSERT INTO t1 VALUES (1);") | ||
table_list = " LEFT JOIN ".join( | ||
f"t1 as a{i} ON (a{i-1}.f1 = a{i}.f1)" for i in cls.no_first() | ||
f"t1 as a{i} ON (a{i - 1}.f1 = a{i}.f1)" for i in cls.no_first() | ||
) | ||
cls.store_explain_and_run(f"SELECT * FROM t1 AS a1 LEFT JOIN {table_list};") | ||
print(" ".join("1" for i in cls.all())) | ||
|
@@ -845,7 +846,7 @@ def body(cls) -> None: | |
print("> CREATE VIEW v0 (f1) AS SELECT f1 FROM t;") | ||
|
||
for i in cls.all(): | ||
print(f"> CREATE VIEW v{i} AS SELECT f1 + 1 AS f1 FROM v{i-1};") | ||
print(f"> CREATE VIEW v{i} AS SELECT f1 + 1 AS f1 FROM v{i - 1};") | ||
|
||
cls.store_explain_and_run(f"SELECT * FROM v{cls.COUNT};") | ||
print(f"{cls.COUNT}") | ||
|
@@ -871,7 +872,7 @@ def body(cls) -> None: | |
|
||
for i in cls.all(): | ||
print( | ||
f"> CREATE MATERIALIZED VIEW v{i} AS SELECT f1 + 1 AS f1 FROM v{i-1};" | ||
f"> CREATE MATERIALIZED VIEW v{i} AS SELECT f1 + 1 AS f1 FROM v{i - 1};" | ||
) | ||
|
||
cls.store_explain_and_run(f"SELECT * FROM v{cls.COUNT};") | ||
|
@@ -907,7 +908,7 @@ def body(cls) -> None: | |
print("> CREATE TABLE t1 (f1 INTEGER);") | ||
print("> INSERT INTO t1 VALUES " + ", ".join(f"({i})" for i in cls.all())) | ||
cte_list = ", ".join( | ||
f"a{i} AS (SELECT f1 + 1 AS f1 FROM a{i-1} WHERE f1 <= {i})" | ||
f"a{i} AS (SELECT f1 + 1 AS f1 FROM a{i - 1} WHERE f1 <= {i})" | ||
for i in cls.no_first() | ||
) | ||
table_list = ", ".join(f"a{i}" for i in cls.all()) | ||
|
@@ -927,7 +928,7 @@ def body(cls) -> None: | |
print("> CREATE TABLE t1 (f1 INTEGER);") | ||
print("> INSERT INTO t1 VALUES (1)") | ||
cte_list = ", ".join( | ||
f"a{i} AS (SELECT a{i-1}.f1 + 0 AS f1 FROM a{i-1}, t1 WHERE a{i-1}.f1 = t1.f1)" | ||
f"a{i} AS (SELECT a{i - 1}.f1 + 0 AS f1 FROM a{i - 1}, t1 WHERE a{i - 1}.f1 = t1.f1)" | ||
for i in cls.no_first() | ||
) | ||
cls.store_explain_and_run( | ||
|
@@ -952,7 +953,7 @@ def body(cls) -> None: | |
for i in cls.all() | ||
) | ||
cls.store_explain_and_run(f"SELECT * FROM {table_list};") | ||
print(" ".join(f"{i+1}" for i in cls.all())) | ||
print(" ".join(f"{i + 1}" for i in cls.all())) | ||
|
||
|
||
class Lateral(Generator): | ||
|
@@ -967,7 +968,7 @@ def body(cls) -> None: | |
print("> CREATE TABLE t1 (f1 INTEGER);") | ||
print("> INSERT INTO t1 VALUES (1)") | ||
table_list = ", LATERAL ".join( | ||
f"(SELECT t1.f1 + {i-1} AS f1 FROM t1 WHERE f1 <= a{i-1}.f1) AS a{i}" | ||
f"(SELECT t1.f1 + {i - 1} AS f1 FROM t1 WHERE f1 <= a{i - 1}.f1) AS a{i}" | ||
for i in cls.no_first() | ||
) | ||
cls.store_explain_and_run(f"SELECT * FROM t1 AS a1 , LATERAL {table_list};") | ||
|
@@ -1275,7 +1276,7 @@ def body(cls) -> None: | |
) | ||
print("> CREATE DEFAULT INDEX ON v") | ||
cls.store_explain_and_run("SELECT LENGTH(c) FROM v") | ||
print(f"{cls.COUNT*1024}") | ||
print(f"{cls.COUNT * 1024}") | ||
|
||
|
||
class ArrayAgg(Generator): | ||
|
@@ -1286,25 +1287,27 @@ def body(cls) -> None: | |
print("> SET statement_timeout='300s'") | ||
print( | ||
f"""> CREATE TABLE t ({ | ||
", ".join( | ||
", ".join([ | ||
f"a{i} STRING", | ||
f"b{i} STRING", | ||
f"c{i} STRING", | ||
f"d{i} STRING[]", | ||
]) | ||
for i in cls.all() | ||
) | ||
});""" | ||
", ".join( | ||
", ".join( | ||
[ | ||
f"a{i} STRING", | ||
f"b{i} STRING", | ||
f"c{i} STRING", | ||
f"d{i} STRING[]", | ||
] | ||
) | ||
for i in cls.all() | ||
) | ||
});""" | ||
) | ||
print("> INSERT INTO t DEFAULT VALUES;") | ||
print( | ||
f"""> CREATE MATERIALIZED VIEW v2 AS SELECT { | ||
", ".join( | ||
f"ARRAY_AGG(a{i} ORDER BY b1) FILTER (WHERE 's{i}' = ANY(d{i})) AS r{i}" | ||
for i in cls.all() | ||
) | ||
} FROM t GROUP BY a1;""" | ||
", ".join( | ||
f"ARRAY_AGG(a{i} ORDER BY b1) FILTER (WHERE 's{i}' = ANY(d{i})) AS r{i}" | ||
for i in cls.all() | ||
) | ||
} FROM t GROUP BY a1;""" | ||
Comment on lines
+1290
to
+1310
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah sorry this is my auto formatter |
||
) | ||
print("> CREATE DEFAULT INDEX ON v2;") | ||
|
||
|
@@ -1790,6 +1793,7 @@ def app_password(email: str) -> str: | |
], | ||
), | ||
Cockroach(in_memory=True), | ||
PostgresMetadata(), | ||
Materialized( | ||
memory="8G", | ||
cpu="2", | ||
|
@@ -1810,7 +1814,7 @@ def app_password(email: str) -> str: | |
], | ||
sanity_restart=False, | ||
external_metadata_store=True, | ||
metadata_store="cockroach", | ||
metadata_store="postgres-metadata", | ||
), | ||
Mz(app_password=""), | ||
] | ||
|
@@ -1819,7 +1823,11 @@ def app_password(email: str) -> str: | |
for replica_id in range(1, MAX_REPLICAS + 1): | ||
for node_id in range(1, MAX_NODES + 1): | ||
SERVICES.append( | ||
Clusterd(name=f"clusterd_{cluster_id}_{replica_id}_{node_id}", cpu="2") | ||
Clusterd( | ||
name=f"clusterd_{cluster_id}_{replica_id}_{node_id}", | ||
cpu="2", | ||
memory="4G", | ||
) | ||
) | ||
|
||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
auto formatter from my editor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bin/pyfmt
is your friend.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah thanks!