Skip to content

[spark] Add scan.maxRecordsPerPartition config to split log table input partitions#3260

Merged
fresh-borzoni merged 2 commits into
apache:mainfrom
Yohahaha:spark-split-partition
Jun 9, 2026
Merged

[spark] Add scan.maxRecordsPerPartition config to split log table input partitions#3260
fresh-borzoni merged 2 commits into
apache:mainfrom
Yohahaha:spark-split-partition

Conversation

@Yohahaha

@Yohahaha Yohahaha commented May 7, 2026

Copy link
Copy Markdown
Contributor

Purpose

Linked issue: close #3215

Brief change log

  • Introduce scan.maxRecordsPerPartition config option for Spark log table reads. When set, each Fluss
    bucket whose offset range exceeds this value will be split into multiple Spark input partitions, improving
    read parallelism for large offset ranges.
  • Update BucketOffsetsRetrieverImpl to support fetching real earliest offsets when needed.

Tests

SparkLogTableReadTest: "Spark Read: split partition by config"

API and Format

Documentation

@Yohahaha Yohahaha marked this pull request as ready for review May 7, 2026 02:52
@Yohahaha

Yohahaha commented May 7, 2026

Copy link
Copy Markdown
Contributor Author

@YannByron

@Yohahaha

Yohahaha commented May 7, 2026

Copy link
Copy Markdown
Contributor Author

@luoyuxia @fresh-borzoni PTAL!

@fresh-borzoni fresh-borzoni left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@Yohahaha Ty for the PR, overall LGTM, left minor comments, PTAL

@Yohahaha Yohahaha force-pushed the spark-split-partition branch from 75e67cc to 4bc7805 Compare May 13, 2026 10:53
@Yohahaha

Copy link
Copy Markdown
Contributor Author

@luoyuxia @YannByron more comments?

@fresh-borzoni fresh-borzoni left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@Yohahaha Ty for the changes, LGTM 👍 , just minor comment

@Yohahaha Yohahaha changed the title [spark] Add scan.max.records.per.partition config to split log table input partitions [spark] Add scan.maxRecordsPerPartition config to split log table input partitions May 15, 2026
@fresh-borzoni

Copy link
Copy Markdown
Member

@Yohahaha you need to update config key in tests to fix tests

@Yohahaha Yohahaha force-pushed the spark-split-partition branch from d1a698b to 72ee21e Compare May 17, 2026 08:16
@Yohahaha

Copy link
Copy Markdown
Contributor Author

@luoyuxia PTAL!

@Yohahaha Yohahaha force-pushed the spark-split-partition branch from 72ee21e to a1ad761 Compare June 1, 2026 10:58
@Yohahaha Yohahaha force-pushed the spark-split-partition branch from a1ad761 to e9082dc Compare June 2, 2026 06:51

@fresh-borzoni fresh-borzoni left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@Yohahaha Ty for the change, LGTM overall, couple of comments, PTAL

startOffset: Long,
stopOffset: Long,
maxRecords: Long): Seq[InputPartition] = {
if (

@fresh-borzoni fresh-borzoni Jun 2, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

what about empty tables and buckets?

@fresh-borzoni fresh-borzoni merged commit ba0e627 into apache:main Jun 9, 2026
7 checks passed
@Yohahaha Yohahaha deleted the spark-split-partition branch June 9, 2026 13:51
@Yohahaha

Yohahaha commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

@fresh-borzoni Sorry, I've been busy with other higher priority stuff lately, so I didn't get a chance to address the PR comments.
Thanks for merging it!

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.

[spark] Add config to split input partition by input size

3 participants