You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Dennis-Mircea (via GitHub)" <gi...@apache.org> on 2026/05/01 15:20:49 UTC
[PR] [FLINK-39588][flink-table][connector/datagen] Migrate the DataGen table connector off deprecated source APIs [flink]
Dennis-Mircea opened a new pull request, #28083:
URL: https://github.com/apache/flink/pull/28083
<!--
*Thank you very much for contributing to Apache Flink - we are happy that you want to help us improve Flink. To help the community review your contribution in the best possible way, please go through the checklist below, which will get the contribution into a shape in which it can be best reviewed.*
*Please understand that we do not do this to make contributions to Flink a hassle. In order to uphold a high standard of quality for code contributions, while at the same time managing a large number of contributions, we need contributors to prepare the contributions well, and give reviewers enough contextual information for the review. Please also understand that contributions that do not follow this guide will take longer to review and thus typically be picked up with lower priority by the community.*
## Contribution Checklist
- Make sure that the pull request corresponds to a [JIRA issue](https://issues.apache.org/jira/projects/FLINK/issues). Exceptions are made for typos in JavaDoc or documentation files, which need no JIRA issue.
- Name the pull request in the form "[FLINK-XXXX] [component] Title of the pull request", where *FLINK-XXXX* should be replaced by the actual issue number. Skip *component* if you are unsure about which is the best component.
Typo fixes that have no associated JIRA issue should be named following this pattern: `[hotfix] [docs] Fix typo in event time introduction` or `[hotfix] [javadocs] Expand JavaDoc for PuncuatedWatermarkGenerator`.
- Fill out the template below to describe the changes contributed by the pull request. That will give reviewers the context they need to do the review.
- Make sure that the change passes the automated tests, i.e., `mvn clean verify` passes. You can set up Azure Pipelines CI to do that following [this guide](https://cwiki.apache.org/confluence/display/FLINK/Azure+Pipelines#AzurePipelines-Tutorial:SettingupAzurePipelinesforaforkoftheFlinkrepository).
- Each pull request should address only one issue, not mix up code from multiple issues.
- Each commit in the pull request has a meaningful commit message (including the JIRA id)
- Once all items of the checklist are addressed, remove the above text and this checklist, leaving only the filled out template below.
**(The sections below can be removed for hotfixes of typos)**
-->
## What is the purpose of the change
This pull request migrates the built-in `'connector' = 'datagen'` table source (`DataGenTableSource` in `flink-table-api-java-bridge`) off the long-deprecated `SourceFunctionProvider` and the legacy `SourceFunction`-based `DataGeneratorSource` / `RandomGenerator` / `SequenceGenerator` hierarchy, onto the FLIP-27 source stack (`Source` API + `SourceProvider`).
These were the last remaining usages of those deprecated APIs from a built-in table connector and contributed a sizeable chunk of the frozen entries in `flink-architecture-tests-production`. User-visible behavior of the connector is preserved: same DDL options, same value distributions, same parallelism, same `rows-per-second` rate limiting, and same termination semantics for bounded sequence fields.
## Brief change log
- Replaced `SourceFunctionProvider` with `SourceProvider.of(Source, parallelism)` in `DataGenTableSource`.
- Switched the underlying source to FLIP-27 `org.apache.flink.connector.datagen.source.DataGeneratorSource`, driven by a composite `GeneratorFunction<Long, RowData>` and `RateLimiterStrategy.perSecond(rowsPerSecond)`.
- Introduced new `RandomGeneratorFunction<T>` / `SequenceGeneratorFunction<T>` types implementing `GeneratorFunction<Long, T>`, replacing the legacy `RandomGenerator` / `SequenceGenerator` hierarchies. Migrated `RowDataGenerator`, `DataGeneratorMapper`, `DecimalDataRandomGenerator`, `DataGeneratorContainer`, and the random/sequence visitors accordingly.
- Sequence checkpoint state ownership moved from per-generator `ListState<Long>` deques to the `NumberSequenceSource` driving the FLIP-27 source. The legacy "halt when any sequence range is exhausted" semantic is preserved via a source-level effective count (`min(sequenceFieldsTotalCount)` when `number-of-rows` is unset).
- Added `flink-connector-datagen` as a dependency of `flink-table-api-java-bridge`.
- Removed the now-stale entries from `flink-architecture-tests-production/archunit-violations/`.
## Verifying this change
This change added tests and can be verified as follows:
- `DataGenTableSourceFactoryTest` rewritten to drive the generator function directly via `DataGenTableSource#buildRowGenerator()` + `computeEffectiveCount()` (no MiniCluster needed). All 14 existing factory + per-field behavior assertions are retained.
- New test `testSequenceProducesEachValueExactlyOnce` asserts every value in the requested `[start, end]` range is produced exactly once.
- `DecimalDataRandomGeneratorTest` updated for the new `map(Long)` entry point.
- Architecture tests in `flink-architecture-tests-production` pass with the legacy-API violation entries removed from the frozen list.
- Existing ITCases that exercise `'connector' = 'datagen'` (e.g. `DataGeneratorConnectorITCase`, `SqlGatewayServiceITCase`, `AbstractMaterializedTableStatementITCase`, `OpenAIChatModelTest`, `ProcessTableFunctionTest`) continue to pass unchanged.
## Does this pull request potentially affect one of the following parts:
- Dependencies (does it add or upgrade a dependency): **yes** (`flink-table-api-java-bridge` now depends on `flink-connector-datagen`)
- The public API, i.e., is any changed class annotated with `@Public(Evolving)`: no
- The serializers: no
- The runtime per-record code paths (performance sensitive): no
- Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: no
- The S3 file system connector: no
## Documentation
- Does this pull request introduce a new feature? no
- If yes, how is the feature documented? not applicable
---
##### Was generative AI tooling used to co-author this PR?
<!--
If generative AI tooling has been used in the process of authoring this PR, please
change the checkbox below to `[X]` followed by the name of the tool, and uncomment the
"Generated-by" line. See the ASF Generative Tooling Guidance for details:
https://www.apache.org/legal/generative-tooling.html
You are responsible for the quality and correctness of every change in this PR
regardless of the tooling used. Low-effort AI-generated PRs will be closed. See
AGENTS.md for the full guidance.
-->
- [X] Yes (please specify the tool below)
Generated-by: [GitHub Copilot]
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-39588][flink-table][connector/datagen] Migrate the DataGen table connector off deprecated source APIs [flink]
Posted by "flinkbot (via GitHub)" <gi...@apache.org>.
flinkbot commented on PR #28083:
URL: https://github.com/apache/flink/pull/28083#issuecomment-4360066917
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "d78b8727d8b4a397770e339d89c7cc6aa130a568",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "d78b8727d8b4a397770e339d89c7cc6aa130a568",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* d78b8727d8b4a397770e339d89c7cc6aa130a568 UNKNOWN
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run azure` re-run the last Azure build
</details>
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-39588][flink-table][connector/datagen] Migrate the DataGen table connector off deprecated source APIs [flink]
Posted by "featzhang (via GitHub)" <gi...@apache.org>.
featzhang commented on code in PR #28083:
URL: https://github.com/apache/flink/pull/28083#discussion_r3235947871
##########
flink-table/flink-table-api-java-bridge/src/main/java/org/apache/flink/connector/datagen/table/DataGenTableSource.java:
##########
@@ -62,16 +68,61 @@ public DataGenTableSource(
@Override
public ScanRuntimeProvider getScanRuntimeProvider(ScanContext context) {
- boolean isBounded = numberOfRows != null;
- return SourceFunctionProvider.of(createSource(), isBounded, parallelism);
+ TypeInformation<RowData> typeInfo = context.createTypeInformation(rowDataType);
+ return SourceProvider.of(createSource(typeInfo), parallelism);
}
@VisibleForTesting
- public DataGeneratorSource<RowData> createSource() {
+ public DataGeneratorSource<RowData> createSource(TypeInformation<RowData> typeInfo) {
return new DataGeneratorSource<>(
- new RowDataGenerator(fieldGenerators, DataType.getFieldNames(rowDataType), 0),
- rowsPerSecond,
- numberOfRows);
+ buildRowGenerator(),
+ computeEffectiveCount(),
+ RateLimiterStrategy.perSecond(rowsPerSecond),
+ typeInfo);
+ }
+
+ /**
+ * Returns the per-field generator function that produces a single {@link RowData} for a given
+ * sequence index. Exposed for tests that exercise the generation logic directly.
+ */
+ @VisibleForTesting
+ public GeneratorFunction<Long, RowData> buildRowGenerator() {
+ return new RowDataGenerator(fieldGenerators, DataType.getFieldNames(rowDataType), 0);
+ }
+
+ /**
+ * Computes the bound passed to {@link DataGeneratorSource}. When {@code numberOfRows} is
+ * configured we honor it; otherwise we cap the source at the smallest sequence-field range to
+ * preserve the legacy "halt when any sequence field is exhausted" semantic, falling back to
+ * {@link Long#MAX_VALUE} when no sequence fields are present.
+ */
+ @VisibleForTesting
+ public long computeEffectiveCount() {
+ if (numberOfRows != null) {
+ return numberOfRows;
+ }
Review Comment:
Behavior regression when `'number-of-rows'` is set together with one or more `kind=sequence` fields. Legacy `DataGeneratorSource#run` stops as soon as `generator.hasNext()` returns false, i.e. the effective row count is `min(numberOfRows, smallest_sequence_total)`. Here we short-circuit to `numberOfRows` and skip the `min` against `minSequenceCount`, so `NumberSequenceSource` is asked to emit indices past `end - start`, and `SequenceGeneratorFunction#map` happily computes `start + idx` beyond `end`. Two concrete consequences:
1. The invariant declared in `SequenceGeneratorFunction`'s javadoc — *"the source-level count never exceeds `getTotalCount()`, so `start + idx` never wraps past `end`"* — is violated by this very factory call site.
2. For narrowing variants (`byteGenerator` / `shortGenerator` / `intGenerator`), the overflow is silent: e.g. `'fields.f.kind'='sequence'`, `start=0`, `end=10` on a `TINYINT` column with `'number-of-rows'='300'` previously stopped at row 11; with this patch it keeps going and emits `(byte)128 = -128`, etc.
Fix is the obvious one: when `hasSequence`, return `Math.min(numberOfRows, minSequenceCount)`. Worth a unit case in `DataGenTableSourceFactoryTest` covering `numberOfRows > sequence_total` to lock the legacy semantic in.
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-39588][flink-table][connector/datagen] Migrate the DataGen table connector off deprecated source APIs [flink]
Posted by "featzhang (via GitHub)" <gi...@apache.org>.
featzhang commented on PR #28083:
URL: https://github.com/apache/flink/pull/28083#issuecomment-4468971018
## Checkpoint compatibility
State format changed completely: `SequenceGenerator`'s per-generator `ListState<Long>` → `NumberSequenceSource`'s internal state. Existing checkpoints with sequence fields can't restore.
If DataGen is production-used, need migration path. If test-only (likely), document it:
```java
/**
* DataGen is for testing/dev only. State compatibility not guaranteed.
* Do not use in production with checkpoint recovery.
*/
```
Add to release notes as breaking change.
## Missing tests
### Checkpoint restore
```java
@Test
void testCheckpointRestore() {
// Run sequence [0,100] to index 50, checkpoint, restore, verify continues from 51
}
```
### Edge cases
```java
@Test
void testNumberOfRowsZero() {
// 'number-of-rows' = '0', expect immediate finish
}
@Test
void testNumberOfRowsExceedsLongMax() {
// 'number-of-rows' = '9223372036854775807', verify no overflow
}
@Test
void testSequenceStartEqualsEnd() {
// start = end = 42, expect single row with value 42
}
@Test
void testMultipleSequenceFieldsDifferentRanges() {
// field1: [0, 1000000], field2: [0, 10]
// number-of-rows unset → expect stops at 11 (min wins)
}
@Test
void testSequenceTinyintOverflow() {
// TINYINT sequence [0, 10], number-of-rows = 300
// expect stops at 11, NOT wraps to -128
}
@Test
void testParallelismGreaterThanOne() {
// parallelism = 4, number-of-rows = 100
// verify each subtask gets ~25, total = 100, no duplicates
}
@Test
void testRateLimiterAccuracy() {
// rows-per-second = 100, run for 1s, expect 95-105 rows (5% tolerance)
}
```
### Nullability
```java
@Test
void testNullableFieldsWithRandomGenerator() {
// Random generator on nullable column, verify nulls generated
}
```
Clarify:
1. Is DataGen ever used in production?
2. Does FLIP-27 have auto state migration?
3. Should old state detection fail fast with clear error?
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-39588][flink-table][connector/datagen] Migrate the DataGen table connector off deprecated source APIs [flink]
Posted by "Dennis-Mircea (via GitHub)" <gi...@apache.org>.
Dennis-Mircea commented on code in PR #28083:
URL: https://github.com/apache/flink/pull/28083#discussion_r3243720300
##########
flink-table/flink-table-api-java-bridge/src/main/java/org/apache/flink/connector/datagen/table/DataGenTableSource.java:
##########
@@ -62,16 +68,61 @@ public DataGenTableSource(
@Override
public ScanRuntimeProvider getScanRuntimeProvider(ScanContext context) {
- boolean isBounded = numberOfRows != null;
- return SourceFunctionProvider.of(createSource(), isBounded, parallelism);
+ TypeInformation<RowData> typeInfo = context.createTypeInformation(rowDataType);
+ return SourceProvider.of(createSource(typeInfo), parallelism);
}
@VisibleForTesting
- public DataGeneratorSource<RowData> createSource() {
+ public DataGeneratorSource<RowData> createSource(TypeInformation<RowData> typeInfo) {
return new DataGeneratorSource<>(
- new RowDataGenerator(fieldGenerators, DataType.getFieldNames(rowDataType), 0),
- rowsPerSecond,
- numberOfRows);
+ buildRowGenerator(),
+ computeEffectiveCount(),
+ RateLimiterStrategy.perSecond(rowsPerSecond),
+ typeInfo);
+ }
+
+ /**
+ * Returns the per-field generator function that produces a single {@link RowData} for a given
+ * sequence index. Exposed for tests that exercise the generation logic directly.
+ */
+ @VisibleForTesting
+ public GeneratorFunction<Long, RowData> buildRowGenerator() {
+ return new RowDataGenerator(fieldGenerators, DataType.getFieldNames(rowDataType), 0);
+ }
+
+ /**
+ * Computes the bound passed to {@link DataGeneratorSource}. When {@code numberOfRows} is
+ * configured we honor it; otherwise we cap the source at the smallest sequence-field range to
+ * preserve the legacy "halt when any sequence field is exhausted" semantic, falling back to
+ * {@link Long#MAX_VALUE} when no sequence fields are present.
+ */
+ @VisibleForTesting
+ public long computeEffectiveCount() {
+ if (numberOfRows != null) {
+ return numberOfRows;
+ }
Review Comment:
Good catch, thanks @featzhang! You're right, the legacy semantics required `Math.min(numberOfRows, minSequenceCount)`. Fixed in the next push, plus two tests in `DataGenTableSourceFactoryTest` covering both directions (row-count wins, sequence wins with `TINYINT` overflow guard).
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-39588][flink-table][connector/datagen] Migrate the DataGen table connector off deprecated source APIs [flink]
Posted by "Dennis-Mircea (via GitHub)" <gi...@apache.org>.
Dennis-Mircea commented on PR #28083:
URL: https://github.com/apache/flink/pull/28083#issuecomment-4702300159
> my AI raised these issues:
>
> #### 1. already fixed
> #### 2. **Potential Null Safety Issue**
> **Location:** `DataGenTableSourceFactoryTest.stubReaderContext()`
>
> ```java
> private static SourceReaderContext stubReaderContext() {
> return null;
> }
> ```
>
> **Concern:** Returning `null` for `SourceReaderContext` is risky. While the comment states generators don't invoke methods on the context, this creates a fragile contract:
>
> * Future generator implementations might call context methods
> * NPE would occur at runtime, not compile time
> * No compile-time safety
>
> **Recommendation:** Use a proper stub/mock implementation:
>
> ```java
> private static SourceReaderContext stubReaderContext() {
> return new SourceReaderContext() {
> @Override public int currentParallelism() { return 1; }
> @Override public int getIndexOfSubtask() { return 0; }
> // ... implement other methods with sensible defaults
> };
> }
> ```
>
> #### 3. **Missing Javadoc on Public Test Methods**
> **Location:** `DataGenTableSourceFactoryTest`
>
> Several new test methods lack Javadoc:
>
> * `testSequenceProducesEachValueExactlyOnce()`
> * `testEffectiveCountIsCappedByRowCountWhenSmaller()`
> * `testEffectiveCountIsCappedBySequenceWhenRowCountLarger()`
>
> **Recommendation:** Add brief Javadoc explaining what behavior each test verifies.
>
> #### 4. **Serialization Not Explicitly Tested**
> **Observation:** The old test had explicit serialization testing:
>
> ```java
> gen = InstantiationUtil.clone(gen);
> ```
>
> The new implementation removes this. While the `serialVersionUID` fields are present, there's no explicit verification that the new generator functions are properly serializable.
>
> **Recommendation:** Add a test that clones a generator function and verifies it still works:
>
> ```java
> @Test
> void testGeneratorFunctionSerialization() throws Exception {
> GeneratorFunction<Long, RowData> original = buildRowGenerator(...);
> GeneratorFunction<Long, RowData> cloned =
> InstantiationUtil.clone(original);
> cloned.open(stubReaderContext());
> // Verify cloned generator produces expected output
> }
> ```
>
> #### 5. **Magic Number in Test**
> **Location:** `DataGenTableSourceFactoryTest.runGenerator()`
>
> ```java
> long limit = count == Long.MAX_VALUE ? 1_000L : count;
> ```
>
> The `1_000L` is a magic number. Should be a named constant:
>
> ```java
> private static final long DEFAULT_UNBOUNDED_TEST_LIMIT = 1_000L;
> ```
Thanks @davidradl, appreciate the careful pass. Addressed below:
1. I don't understand this point. What is already fixed?
2. **(null `SourceReaderContext`)** - I've left this as-is. The stub is documented: the generator functions only use `open()` for one-time initialization and never call any method on the context, so a `null`-returning stub is sufficient and the contract is spelled out in the Javadoc. If a future generator starts using the context, the right move would be to switch to the existing `TestingReaderContext` from `flink-connector-test-utils` rather than hand-roll an anonymous class, but pulling that test dependency into `flink-table-api-java-bridge` isn't justified today.
3. **(Javadoc on test methods)** - I'd prefer to skip this one. Flink test methods are package-private (not public) and the codebase convention is generally no Javadoc on tests. The names (`testSequenceProducesEachValueExactlyOnce`, etc.) are intended to be self-documenting.
4. **(serialization not explicitly tested)** - good catch, this was the one with real value. The generator functions are shipped to the TaskManagers, so serializability matters. Added `testRowGeneratorIsSerializable`, which clones the freshly built `GeneratorFunction<Long, RowData>` via `InstantiationUtil.clone(...)` and verifies the round-tripped copy still produces the full sequence. (Note the existing `datagen` ITCases already exercise the serialization path end-to-end through a MiniCluster. This just adds cheap unit-level coverage)
5. **(magic number)** - done. Extracted `1_000L` into a named constant `DEFAULT_UNBOUNDED_TEST_LIMIT` with a comment explaining when the cap applies.
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-39588][flink-table][connector/datagen] Migrate the DataGen table connector off deprecated source APIs [flink]
Posted by "Dennis-Mircea (via GitHub)" <gi...@apache.org>.
Dennis-Mircea commented on PR #28083:
URL: https://github.com/apache/flink/pull/28083#issuecomment-4469943757
> ## Checkpoint compatibility
> State format changed completely: `SequenceGenerator`'s per-generator `ListState<Long>` → `NumberSequenceSource`'s internal state. Existing checkpoints with sequence fields can't restore.
>
> If DataGen is production-used, need migration path. If test-only (likely), document it:
>
> ```java
> /**
> * DataGen is for testing/dev only. State compatibility not guaranteed.
> * Do not use in production with checkpoint recovery.
> */
> ```
>
> Add to release notes as breaking change.
>
> ## Missing tests
> ### Checkpoint restore
> ```java
> @Test
> void testCheckpointRestore() {
> // Run sequence [0,100] to index 50, checkpoint, restore, verify continues from 51
> }
> ```
>
> ### Edge cases
> ```java
> @Test
> void testNumberOfRowsZero() {
> // 'number-of-rows' = '0', expect immediate finish
> }
>
> @Test
> void testNumberOfRowsExceedsLongMax() {
> // 'number-of-rows' = '9223372036854775807', verify no overflow
> }
>
> @Test
> void testSequenceStartEqualsEnd() {
> // start = end = 42, expect single row with value 42
> }
>
> @Test
> void testMultipleSequenceFieldsDifferentRanges() {
> // field1: [0, 1000000], field2: [0, 10]
> // number-of-rows unset → expect stops at 11 (min wins)
> }
>
> @Test
> void testSequenceTinyintOverflow() {
> // TINYINT sequence [0, 10], number-of-rows = 300
> // expect stops at 11, NOT wraps to -128
> }
>
> @Test
> void testParallelismGreaterThanOne() {
> // parallelism = 4, number-of-rows = 100
> // verify each subtask gets ~25, total = 100, no duplicates
> }
>
> @Test
> void testRateLimiterAccuracy() {
> // rows-per-second = 100, run for 1s, expect 95-105 rows (5% tolerance)
> }
> ```
>
> ### Nullability
> ```java
> @Test
> void testNullableFieldsWithRandomGenerator() {
> // Random generator on nullable column, verify nulls generated
> }
> ```
>
> Clarify:
>
> 1. Is DataGen ever used in production?
> 2. Does FLIP-27 have auto state migration?
> 3. Should old state detection fail fast with clear error?
Thanks for the review @featzhang! Responses below.
### 1. Checkpoint compatibility
Correct that the state layouts are unrelated. There is no automatic bridge, and to my knowledge no FLIP-27 migration in Flink (Kafka, file, Kinesis, …) has preserved state from its legacy `SourceFunction` predecessor. That's the established pattern.
DataGen is already documented as a testing/dev source (the `flink-connector-datagen` module is described as "DataGen source for testing"), so I'd rather not duplicate that warning on the class Javadoc.
### 2. Missing tests
Several of the items are already covered after your previous comment:
- **Multiple sequence fields, smallest range wins** → `testEffectiveCountIsCappedBySequenceWhenRowCountLarger` exercises the `min`-of-`getTotalCount()` semantic directly on `computeEffectiveCount`.
- **Parallelism > 1** → `testWithParallelism` (the existing assertion was extended to cover the FLIP-27 wiring).
- **Nullable random fields** → null-rate logic was preserved byte-for-byte in `RandomGeneratorFunction#nextWithNullRate`; `testSource` / `testVariableLengthDataGeneration` exercise nullable columns end-to-end.
I've added two of your suggestions in a follow-up commit:
- `testNumberOfRowsZero` - asserts `computeEffectiveCount() == 0` and an empty result set.
- `testSequenceStartEqualsEnd` - single-row sequence asserts `getTotalCount() == 1` and the exact emitted value.
Declining the rest:
- `testCheckpointRestore` - the restore path lives entirely in `NumberSequenceSource` and is covered by its own tests; this PR didn't change that surface.
- `testNumberOfRowsExceedsLongMax` - `numberOfRows` is parsed as a `long`; there's no overflow path the connector controls.
- `testSequenceTinyintOverflow` - `SequenceGeneratorFunction#map` computes `convert(start + idx)` where the source-level count is bounded by `getTotalCount() = end - start + 1`. With the cap in `computeEffectiveCount`, wrapping is unreachable; `testEffectiveCountIsCappedBySequenceWhenRowCountLarger` already pins this for `TINYINT` specifically.
- `testRateLimiterAccuracy` - `RateLimiterStrategy.perSecond` is library code with its own tests.
### 3. Clarifications
1. **DataGen in production?** No. It's a testing/dev source by design and by docs.
2. **FLIP-27 state migration?** No automatic bridge from legacy `SourceFunction` state to FLIP-27 source state exists, here or anywhere else in Flink.
3. **Old-state detection with a descriptive message?** The runtime already fails state assignment when an operator's checkpointed state can't be claimed by the new operator. Adding bespoke detection inside a test-only connector isn't worth the complexity.
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org