[Improvement-16754][DataX] Support DataX writer parameter batchSize#18192
Open
leocook wants to merge 1 commit intoapache:devfrom
Open
[Improvement-16754][DataX] Support DataX writer parameter batchSize#18192leocook wants to merge 1 commit intoapache:devfrom
leocook wants to merge 1 commit intoapache:devfrom
Conversation
Add batchSize parameter support for DataX task to control writer batch size. Backend: - Add batchSize field to DataxParameters (lombok @DaTa generates accessors) - Generate batchSize JSON config in DataxTask only when value > 0 - Add unit tests for batchSize parameter Frontend: - Add batchSize select with a static option list (0/1024/2048/4096/8192/16384/32768/65536/131072) - Default to 2048 to match the DataX upstream default; ClickHouse / Databend users can pick 65536 / 131072 from the dropdown - Add zh_CN / en_US i18n entries Closes apache#16754
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Was this PR generated or assisted by AI?
YES — used Claude (Sonnet 4.6 / Opus 4.7) to help review the original design, simplify the implementation (removing per-database dynamic defaults that were the wrong abstraction), and resolve rebase conflicts against
dev. All design decisions, the final approach, and verification were reviewed by me.Purpose of the pull request
DataX writer currently does not expose the
batchSizeparameter, so users are stuck with the DataX default of2048. This is too small for some target databases — e.g. the ClickHouse plugin recommends65536. This PR makesbatchSizeconfigurable from the task UI.Closes #16754
Brief change log
Backend (
dolphinscheduler-task-datax):batchSizefield toDataxParameters(lombok@Datagenerates accessors)DataxTask, writebatchSizeinto the writer JSON only when value > 0, so the DataX upstream default still applies when the user picks0 (unlimited)DataxParametersTestto cover the new fieldFrontend (
dolphinscheduler-ui):batchSizeselect control on the DataX task form0 / 1024 / 2048 / 4096 / 8192 / 16384 / 32768 / 65536 / 1310722048(matches DataX upstream); ClickHouse / Databend users can pick65536/131072from the same listzh_CNanden_USi18n entries (datax_writer_batch_size)Design note: an earlier draft switched the option list and default based on target database type (see issue discussion). That was dropped after review —
batchSizeoptima depend on row width, network, and target hardware, not just on the database, so hard-coding database-specific defaults in the UI is the wrong abstraction. A static list keeps the UI consistent with surrounding fields (jobSpeedByte/jobSpeedRecord/memoryLimit).Verify this pull request
This change added tests and can be verified as follows:
testBatchSizeinDataxParametersTestcovering the new field (default0,2048,65536)toStringassertion inDataxParametersTestto includebatchSize=0batchSize=2048— generated JSON contains"batchSize": 2048underwriter.parameterbatchSize=0— generated JSON omits the field, DataX falls back to its own defaultScreenshots
Pull Request Notice
Pull Request Notice