Skip to content
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

[core] Alter table set option with empty key filter #4797

Closed
wants to merge 2 commits into from

Conversation

xuzifu666
Copy link
Member

Purpose

Linked issue: close #xxx
Currently paimon set properties(options) not filter empty key:

ALTER TABLE T SET ('' = '2 mb');

then show create table :
CREATE TABLE PAIMON.default.T (
a INT,
b INT,
c INT
) WITH (
'scan.infer-parallelism' = 'false',
'path' = '/var/folders/kb/wgkwnwq156g6kcpgldkyjcf00000gp/T/junit3546018753241373391/a5ced1b0-a37b-4879-b035-c14a351168d3/default.db/T',
'' = '2 mb'
'write-manifest-cache' = '1 mb'
)
this pr filter the empty option key

Tests

API and Format

Documentation

@xuzifu666 xuzifu666 changed the title Alter set option [core] Alter table set option with empty key filter Dec 29, 2024
List<SchemaChange> schemaChanges = new ArrayList<>();
for (SchemaChange schemaChange : changes) {
if (schemaChange instanceof SchemaChange.SetOption
&& StringUtils.isEmpty(((SchemaChange.SetOption) schemaChange).key())) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about throw a exception instead of continue?

Copy link
Member Author

@xuzifu666 xuzifu666 Dec 30, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, empty is a non-sense config, maybe filter directly also OK, because if alter multiple config would not be terminated. @wwj6591812

@xuzifu666
Copy link
Member Author

xuzifu666 commented Dec 30, 2024

Communicate with spark community,they suggest spark side also not do the change,this mainly impact in indicate for user, so close it first to keep the same with spark operation, related pr:apache/spark#49329

@xuzifu666 xuzifu666 closed this Dec 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants