[Feature Request]: Add batch sequence retrieval support to the Add Sequence transform
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 45/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- java
調査の方向性
Start with the Add Sequence transform and its documentation at the linked manual page. Check how it retrieves sequence values and how its settings and database connections are handled, then look for related transform tests. Done means an optional batch mode supports a configurable size, retrieves actual sequence values, assigns them to rows, and leaves the existing behavior intact when disabled.
索引モデルが issue の本文から書いたものです。
説明
What would you like to happen?
Current Behavior
The existing Add Sequence transform supports database sequences, but currently retrieves one sequence value for each input row.
For large pipelines, this results in many individual database queries just to generate sequence IDs.
Problem
When processing thousands or millions of rows, retrieving sequence values one at a time introduces unnecessary database round trips and can significantly affect pipeline performance, especially when database latency is high.
For example, processing 100,000 rows currently requires approximately 100,000 sequence retrieval queries.
It would be more efficient to retrieve multiple sequence values in a single query and use them locally until the batch is exhausted.
Proposed Enhancement
I would like the Add Sequence transform to support an optional batch retrieval mode when using database sequences.
The proposed enhancement would allow users to:
- Enable or disable batch sequence retrieval.
- Configure the batch size, for example 1,000 values.
- Support Hop variables for the batch size.
- Retrieve multiple actual sequence values from the database in a single query.
- Keep the retrieved values in memory and assign one value to each incoming row.
- Automatically retrieve another batch when all reserved values have been used.
- Preserve the current behavior when batch retrieval is disabled.
For Oracle, the batch retrieval could use a query similar to:
SELECT SEQ_SERVICO_VIGENCIA.NEXTVAL
FROM DUAL
CONNECT BY LEVEL <= ?
The batch size would be configurable rather than hardcoded.
Each value must come from an actual database sequence evaluation. The implementation should not assume that sequence values are consecutive or generate additional IDs by incrementing the first retrieved value.
Expected Behavior
With a batch size of 1,000:
- The first incoming row triggers a query retrieving 1,000 sequence values.
- The values are stored in memory.
- Each incoming row receives one reserved sequence value.
- After consuming all 1,000 values, another batch is retrieved.
- Processing continues until all incoming rows are handled.
For example, processing 100,000 rows would require approximately 100 batch retrieval queries instead of 100,000 individual queries.
Unused values from the final batch do not need to be reused.
The implementation should also handle concurrent pipeline executions safely, preserving the uniqueness guarantees of the underlying database sequence.
Use Case
I currently use a JavaScript transform in Apache Hop to implement this behavior with an Oracle database.
The script:
- Uses an existing Hop database connection.
- Reads the batch size from a Hop variable, defaulting to 1,000.
- Retrieves actual Oracle
NEXTVALvalues in batches. - Stores the results in memory.
- Assigns one value to each incoming row.
- Retrieves another batch only when needed.
- Uses
BigDecimalto preserve numeric precision.
This approach avoids executing a separate SQL query for every input row.
Having this functionality directly in the Add Sequence transform would eliminate the need for custom JavaScript and make it easier to configure and maintain.
Benefits
- Fewer database round trips when generating sequence IDs.
- Better performance in high-volume ETL pipelines.
- Less dependency on custom JavaScript implementations.
- Configurable batch sizes for different workloads.
- Reuse of existing database connection and sequence settings.
- Backward compatibility with the current Add Sequence behavior.
Reference
Existing Apache Hop Add Sequence documentation:
https://hop.apache.org/manual/latest/pipeline/transforms/addsequence.html
The initial implementation could focus on Oracle, with support for other database types where equivalent batch sequence retrieval is available.
Issue Priority
Priority: 3
Issue Component
Component: Transforms
- 主要言語
- Java
- スター
- 1.6k
- フォーク
- 499
- 平均マージ
- 1日 5時間
- マージ済み PR(30日)
- 316
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
apache/hop のほかの issue
-
Beam P2
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
メンテナーはふだん 1 日以内に返信
-
awaiting triage Hop Gui P3
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
apache/hop#9325 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
awaiting triage Documentation P3
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
awaiting triage Documentation P3
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
メンテナーはふだん 1 日以内に返信
-
awaiting triage Documentation P3
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
CI: LFC/ANTLR caches still use the old lfc/ paths, so the ANTLR jar is downloaded on every run対応中かも @NicoBiernat が今日担当しました。 オープンbug CI
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
lf-lang/reactor-uc#443 ·
メンテナーはふだん 4 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
Card-Forge/forge#13128 ·
メンテナーはふだん 1 日以内に返信
-
client documentation
難易度 1/5 1〜3時間 初心者へのやさしさ 86/100
ClickHouse/clickhouse-java#3469 ·
メンテナーはふだん 1 日以内に返信
-
bug good first issue help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信