Skip to content

Conversation

@userzhy
Copy link
Contributor

@userzhy userzhy commented Dec 25, 2025

Purpose

Linked issue: close #2932

The current Java API documentation examples for Batch Read and Stream Read are missing the executeFilter() call after newRead(). Without calling executeFilter(), the filter conditions specified through withFilter() will not take effect when reading data.

This PR adds the missing executeFilter() call to both examples:

  • Batch Read example (ReadTable.java)
  • Stream Read example (StreamReadTable.java)

Tests

This is a documentation-only change. No code tests are needed.

API and Format

This change does not affect API or storage format. It only fixes the documentation examples.

Documentation

This change fixes existing documentation. No new feature is introduced.

This fixes the documentation where the filter conditions would not take effect
because executeFilter() was not being called after newRead().

Without calling executeFilter(), the filters specified through withFilter()
are not applied when reading data.

Closes apache#2932

// 4. Read a split in task
TableRead read = readBuilder.newRead();
TableRead read = readBuilder.newRead().executeFilter();
Copy link
Contributor

@JingsongLi JingsongLi Dec 25, 2025

Choose a reason for hiding this comment

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

Maybe you can explain this.

// You can use executeFilter to do filter per record
// By default, only capable of performing coarse-grained filtering
read.executeFilter();

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed, thanks!

Add explanatory comments for executeFilter() call based on review feedback:
- You can use executeFilter to do filter per record
- By default, only capable of performing coarse-grained filtering
@JingsongLi
Copy link
Contributor

+1

@JingsongLi JingsongLi merged commit f45c6f2 into apache:master Dec 25, 2025
2 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.

[Bug] The Paimon official website's lacking execution condition statement in stream-read demo code

2 participants