Skip to content

[api] Trim whitespace in the bucket-key option value - #9591

Merged
JingsongLi merged 1 commit into
apache:masterfrom
jackylee-ch:bucket-key-trim
Sep 4, 2026
Merged

[api] Trim whitespace in the bucket-key option value#9591
JingsongLi merged 1 commit into
apache:masterfrom
jackylee-ch:bucket-key-trim

Conversation

@jackylee-ch

Copy link
Copy Markdown
Contributor

Purpose

TableSchema.originalBucketKeys splits bucket-key on , without trimming, so 'bucket-key' = 'id, name' keeps the leading space in the second name and fails the field-name check two lines later with Field names [id, name] should contains all bucket keys [id, name]. The identically formatted 'primary-key' = 'id, name' is accepted, because Schema trims both primary-key and partition.

SparkCatalog.resolveColumnNameList already pre-trims to work around this, so only the Flink SQL, Hive and Java/REST paths hit it.

Tests

TableSchemaTest#testBucketKeyTrimsWhitespaceAroundSeparator.

Written with Claude Code; reasoning and verification are mine.

Schema already trims primary-key and partition, so a space after a comma
is accepted there but turns into part of the column name for bucket-key
and fails the field-name check with a confusing message.
@JingsongLi

Copy link
Copy Markdown
Contributor

+1

@JingsongLi
JingsongLi merged commit de99e88 into apache:master Sep 4, 2026
14 checks passed
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