Skip to content

API: Align CharSequenceSet impl with Data/DeleteFileSet - #11322

Merged
nastra merged 1 commit into
apache:mainfrom
nastra:charseq-set-improvements
Dec 10, 2025
Merged

API: Align CharSequenceSet impl with Data/DeleteFileSet#11322
nastra merged 1 commit into
apache:mainfrom
nastra:charseq-set-improvements

Conversation

@nastra

@nastranastra commented Oct 15, 2024

Copy link
Copy Markdown
Contributor

This aligns the CharSequenceSet implementation with the same behavior that we have for DataFileSet and DeleteFileSet.

Most notably, the current impl of CharSequenceSet isn't consistently handling nulls according to the Set API

@nastra
nastraforce-pushed the charseq-set-improvements branch 2 times, most recently from 887f641 to 2b4592cCompareOctober 15, 2024 12:47
import org.apache.iceberg.relocated.com.google.common.collect.Streams;

public class CharSequenceSet implements Set<CharSequence>, Serializable {
public class CharSequenceSet extends WrapperSet<CharSequence> {

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

might be easier to just look at the resulting file instead of the diff

@nastranastra changed the title Core: Align CharSequenceSet impl with Data/DeleteFileSetAPI: Align CharSequenceSet impl with Data/DeleteFileSetOct 16, 2024
@github-actions

Copy link
Copy Markdown

This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@iceberg.apache.org list. Thank you for your contributions.

@github-actions

Copy link
Copy Markdown

This pull request has been closed due to lack of activity. This is not a judgement on the merit of the PR in any way. It is just a way of keeping the PR queue manageable. If you think that is incorrect, or the pull request requires review, you can revive the PR at any time.

@nastranastra reopened this Nov 25, 2024
@github-actions

Copy link
Copy Markdown

This pull request has been marked as stale due to 30 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the dev@iceberg.apache.org list. Thank you for your contributions.

@github-actions

Copy link
Copy Markdown

This pull request has been closed due to lack of activity. This is not a judgement on the merit of the PR in any way. It is just a way of keeping the PR queue manageable. If you think that is incorrect, or the pull request requires review, you can revive the PR at any time.

@nastra
nastraforce-pushed the charseq-set-improvements branch from 2b4592c to d4cc0bdCompareOctober 30, 2025 11:49
@huaxingao

Copy link
Copy Markdown
Contributor

@nastra Thanks for the PR, this is a nice cleanup and it is consistent with the goal of aligning CharSequenceSet with DataFileSet and DeleteFileSet. There are some behavior changes (e.g., contains, containsAll, toString, etc.). Are these behavior changes expected?

@nastra

Copy link
Copy Markdown
ContributorAuthor

@huaxingao yes the behavioral changes are expected, since we want to align with the expectations of the Set API on those operations, which is what extending WrapperSet enables

@huaxingaohuaxingao left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@singhpk234singhpk234 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM thanks @nastra !

}
return false;
public static CharSequenceSet empty() {
return new CharSequenceSet();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

minor : I wonder if we should make this a static member

private static CharSequenceSet EMPTY = new CharSequenceSet()

public static CharSequenceSet empty() {
return EMPTY;
}

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

we can't do that because empty() is expected to be a modifiable set and making this static will lead to reusing the same Set instance across different places. The equivalent in DataFileSet is create(), but here we historically have empty(). We could however deprecate that method and introduce create(), but this would cause a non-minor diff so I'd leave that to a separate PR

@nastra

Copy link
Copy Markdown
ContributorAuthor

thanks for the reviews @huaxingao and @singhpk234

@nastra
nastra merged commit d894a02 into apache:mainDec 10, 2025
43 checks passed
@nastra
nastra deleted the charseq-set-improvements branch December 10, 2025 19:08
talatuyarer pushed a commit to talatuyarer/iceberg that referenced this pull request Apr 1, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@nastra@huaxingao@singhpk234