-
Notifications
You must be signed in to change notification settings - Fork 182
Add ducklake_target_file_size session setting #1144
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
utay
wants to merge
1
commit into
duckdb:v1.5-variegata
Choose a base branch
from
altertable-ai:yu/session-target-file-size
base: v1.5-variegata
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
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
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
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
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
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
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,54 @@ | ||
| # name: test/sql/insert/insert_session_target_file_size.test | ||
| # description: test that ducklake_target_file_size session setting overrides metadata target_file_size | ||
| # group: [insert] | ||
|
|
||
| require ducklake | ||
|
|
||
| require parquet | ||
|
|
||
| test-env DUCKLAKE_CONNECTION {TEST_DIR}/{UUID}.db | ||
|
|
||
| test-env DATA_PATH {TEST_DIR} | ||
|
|
||
|
|
||
| statement ok | ||
| ATTACH 'ducklake:{DUCKLAKE_CONNECTION}' AS ducklake (DATA_PATH '{DATA_PATH}/ducklake_session_target_file_size') | ||
|
|
||
| statement ok | ||
| CREATE TABLE ducklake.test(id INTEGER, s VARCHAR); | ||
|
|
||
| # Set a large target_file_size in metadata so everything fits in one file | ||
| statement ok | ||
| CALL ducklake.set_option('target_file_size', '512MB') | ||
|
|
||
| # Override with a tiny session setting - should produce multiple files | ||
| statement ok | ||
| SET ducklake_target_file_size = '10KB' | ||
|
|
||
| query I | ||
| INSERT INTO ducklake.test SELECT i, concat('thisisalongstring', i) FROM range(500000) t(i) | ||
| ---- | ||
| 500000 | ||
|
|
||
| # Session setting should have taken precedence: multiple files expected | ||
| query I | ||
| SELECT COUNT(*) > 1 FROM glob('{DATA_PATH}/ducklake_session_target_file_size/main/test/*.parquet') | ||
| ---- | ||
| true | ||
|
|
||
| # Reset the session setting - metadata value (512MB) should now govern: everything in one file | ||
| statement ok | ||
| RESET ducklake_target_file_size | ||
|
Member
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. Can you add a test where you set ducklake_target_file_size after reset? |
||
|
|
||
| statement ok | ||
| CREATE TABLE ducklake.test2(id INTEGER, s VARCHAR); | ||
|
|
||
| query I | ||
| INSERT INTO ducklake.test2 SELECT i, concat('thisisalongstring', i) FROM range(500000) t(i) | ||
| ---- | ||
| 500000 | ||
|
|
||
| query I | ||
| SELECT COUNT(*) = 1 FROM glob('{DATA_PATH}/ducklake_session_target_file_size/main/test2/*.parquet') | ||
| ---- | ||
| true | ||
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.
Can you add a test that verifies a borked string fails at set?
e.g., 'not-a-size'
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.
Can you also cover compaction?
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.
Can you also validate this option is over other scopes? (e.g., per-schema, per-table)
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.
what happens if we set to '0'?