forked from ClickHouse/ClickHouse
-
Notifications
You must be signed in to change notification settings - Fork 18
[WIP] Do not read metadata.json on initial host with remote initiator #1760
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
Open
ianton-ru
wants to merge
3
commits into
antalya-26.3
Choose a base branch
from
feature/antalya-26.3/remote_initiator_optimization
base: antalya-26.3
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.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
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
80 changes: 80 additions & 0 deletions
80
tests/integration/test_storage_iceberg_with_spark/test_remote_initiator.py
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 |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| import pytest | ||
|
|
||
| from helpers.iceberg_utils import ( | ||
| get_uuid_str, | ||
| create_iceberg_table, | ||
| execute_spark_query_general, | ||
| ) | ||
|
|
||
|
|
||
| @pytest.mark.parametrize("storage_type", ["s3"]) | ||
| def test_remote_initiator_with_changed_table(started_cluster_iceberg_with_spark, storage_type): | ||
| instance = started_cluster_iceberg_with_spark.instances["node1"] | ||
| spark = started_cluster_iceberg_with_spark.spark_session | ||
| TABLE_NAME = "test_remote_initiator_with_changed_table_" + get_uuid_str() | ||
| VIEW_NAME = TABLE_NAME + "_view" | ||
|
|
||
| def execute_spark_query(query: str): | ||
| return execute_spark_query_general( | ||
| spark, | ||
| started_cluster_iceberg_with_spark, | ||
| storage_type, | ||
| TABLE_NAME, | ||
| query, | ||
| ) | ||
|
|
||
| execute_spark_query( | ||
| f""" | ||
| CREATE TABLE {TABLE_NAME} ( | ||
| tag INT, | ||
| number INT | ||
| ) | ||
| USING iceberg | ||
| PARTITIONED BY (identity(tag)) | ||
| OPTIONS('format-version'='2') | ||
| """ | ||
| ) | ||
|
|
||
| execute_spark_query( | ||
| f""" | ||
| INSERT INTO {TABLE_NAME} VALUES | ||
| (1, 1) | ||
| """ | ||
| ) | ||
|
|
||
| create_iceberg_table(storage_type, instance, TABLE_NAME, started_cluster_iceberg_with_spark) | ||
|
|
||
| res = instance.query(f""" | ||
| SELECT * | ||
| FROM {TABLE_NAME} | ||
| WHERE number=1 | ||
| SETTINGS | ||
| object_storage_remote_initiator=1, | ||
| object_storage_cluster='cluster_simple' | ||
| """) | ||
|
|
||
| assert res == "1\t1\n" | ||
|
|
||
| execute_spark_query( | ||
| f""" | ||
| ALTER TABLE {TABLE_NAME} ADD COLUMN number2 INT AFTER number; | ||
| """ | ||
| ) | ||
|
|
||
| execute_spark_query( | ||
| f""" | ||
| INSERT INTO {TABLE_NAME} VALUES | ||
| (2, 2, 2) | ||
| """ | ||
| ) | ||
|
|
||
| res = instance.query(f""" | ||
| SELECT * | ||
| FROM {TABLE_NAME} | ||
| WHERE number2=2 | ||
| SETTINGS | ||
| object_storage_remote_initiator=1, | ||
| object_storage_cluster='cluster_simple' | ||
| """) | ||
|
|
||
| assert res == "2\t2\t2\n" |
Oops, something went wrong.
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.
Returning early when
object_storage_remote_initiatoris enabled skips all dynamic metadata refresh on the initiating node, so its in-memory schema/state can become stale after Iceberg/DeltaLake snapshot changes. The initiator still performs query analysis and buildsstorage_snapshotlocally (e.g., before rewriting toremote(...)), so a query that references newly added columns can fail at analysis with unknown-column errors even though the remote node has up-to-date metadata. Previously this path always calledconfiguration->update, so this is a regression for sessions that keepobject_storage_remote_initiator=1across evolving lakehouse tables.Useful? React with 👍 / 👎.
Uh oh!
There was an error while loading. Please reload this page.
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.
It's true. Add test (failed now), need to fix somehow.