goutamadwant opened a new pull request, #13742:
URL: https://github.com/apache/seatunnel/pull/13742
### Purpose of this pull request
Closes #13741.
The LLM transform sent one request per row and ignored `process_batch_size`;
a transform had no way to release held rows before a checkpoint or at end of
input.
| Case | Before | After |
|---|---|---|
| `process_batch_size` unset | one request per row | unchanged (default 1) |
| `process_batch_size = 20`, 100 rows | option ignored | 5 requests, values
assigned in order |
| Partial batch at checkpoint, flush signal, schema change, end of input |
n/a | sent before the boundary |
| Wrong number of answers or failed request | n/a | that batch sent one row
per request, WARN with counts |
| Other flat-map transforms | | unchanged, default `flush()` is empty |
Changes:
- `SeaTunnelFlatMapTransform#flush()`: returns held rows in input order,
default empty.
- Zeta `TransformFlowLifeCycle`: flushes the chain on `CheckpointBarrier`,
`FlushSignal`, `SchemaChangeEvent`; released rows keep their own stain trace.
- Flink `TransformFlatMapOperator` (`prepareSnapshotPreBarrier`, `endInput`)
replaces `DataStream#flatMap`; Spark `TransformMapPartitionsFunction` flushes
at partition end.
- `LLMTransform` implements the flat-map contract next to its map contract
(serialization fixture still reads); `LLMMultiCatalogTransform` is a flat-map
wrapper.
- `process_batch_size` on the LLM transform defaults to 1; alias
`inference_batch_size` kept; unused `INFERENCE_BATCH_SIZE` constant removed.
- On Zeta a flush signal runs the batch request on the delivering thread
(the timer thread when chained to the source), like the chained sink's timer
flush.
### Does this PR introduce _any_ user-facing change?
Yes: `process_batch_size` on the LLM transform works, default 1 keeps
current requests; new no-op-default API `SeaTunnelFlatMapTransform#flush()`.
### How was this patch tested?
| Check | Result |
|---|---|
| `LLMBatchInferenceTest` (12): batch, flush, fallbacks, alias, strict
boolean, wrapper | pass |
| `TransformFlowLifeCycleFlushTest` (Zeta, 9),
`TransformFlatMapOperatorTest` (Flink harness, 2), Spark
`TransformExecuteProcessorTest` (+2), `ChainedFlatMapTransformFlushTest` (2) |
pass |
| `LLMBooleanOutputTest` legacy serialization fixture | still reads |
| Module suites, JDK 11 and 17: api 443, transforms-v2 2056,
flink-starter-common 19, spark-starter-common 26, engine-server lifecycle/error
suites 43 | all pass, spotless clean |
| E2E `TestLLMIT` on Zeta (11), new batch case: 5 rows, batch 2, mock server
verifies 3 requests | pass; Flink/Spark left to CI |
### Check list
* [x] If any new Jar binary package adding in your PR, please add License
Notice according
[New License
Guide](https://github.com/apache/seatunnel/blob/dev/docs/en/developer/new-license.md)
(no new dependency; Flink test-jars, test scope)
* [x] If necessary, please update the documentation to describe the new
feature. https://github.com/apache/seatunnel/tree/dev/docs
(`docs/en|zh/transforms/llm.md`,
`docs/en|zh/architecture/transform-plugin-system.md`)
* [x] If necessary, please update `incompatible-changes.md` to describe the
incompatibility caused by this PR. (not needed)
* [ ] If you are contributing the connector code, please check that the
following files are updated: (not a connector)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]