[FLINK-39588][flink-table][connector/datagen] Migrate the DataGen table connector off deprecated source APIs#28083
Open
Dennis-Mircea wants to merge 1 commit intoapache:masterfrom
Open
[FLINK-39588][flink-table][connector/datagen] Migrate the DataGen table connector off deprecated source APIs#28083Dennis-Mircea wants to merge 1 commit intoapache:masterfrom
Dennis-Mircea wants to merge 1 commit intoapache:masterfrom
Conversation
Collaborator
…le connector off deprecated source APIs
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.
What is the purpose of the change
This pull request migrates the built-in
'connector' = 'datagen'table source (DataGenTableSourceinflink-table-api-java-bridge) off the long-deprecatedSourceFunctionProviderand the legacySourceFunction-basedDataGeneratorSource/RandomGenerator/SequenceGeneratorhierarchy, onto the FLIP-27 source stack (SourceAPI +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, samerows-per-secondrate limiting, and same termination semantics for bounded sequence fields.Brief change log
SourceFunctionProviderwithSourceProvider.of(Source, parallelism)inDataGenTableSource.org.apache.flink.connector.datagen.source.DataGeneratorSource, driven by a compositeGeneratorFunction<Long, RowData>andRateLimiterStrategy.perSecond(rowsPerSecond).RandomGeneratorFunction<T>/SequenceGeneratorFunction<T>types implementingGeneratorFunction<Long, T>, replacing the legacyRandomGenerator/SequenceGeneratorhierarchies. MigratedRowDataGenerator,DataGeneratorMapper,DecimalDataRandomGenerator,DataGeneratorContainer, and the random/sequence visitors accordingly.ListState<Long>deques to theNumberSequenceSourcedriving the FLIP-27 source. The legacy "halt when any sequence range is exhausted" semantic is preserved via a source-level effective count (min(sequenceFieldsTotalCount)whennumber-of-rowsis unset).flink-connector-datagenas a dependency offlink-table-api-java-bridge.flink-architecture-tests-production/archunit-violations/.Verifying this change
This change added tests and can be verified as follows:
DataGenTableSourceFactoryTestrewritten to drive the generator function directly viaDataGenTableSource#buildRowGenerator()+computeEffectiveCount()(no MiniCluster needed). All 14 existing factory + per-field behavior assertions are retained.testSequenceProducesEachValueExactlyOnceasserts every value in the requested[start, end]range is produced exactly once.DecimalDataRandomGeneratorTestupdated for the newmap(Long)entry point.flink-architecture-tests-productionpass with the legacy-API violation entries removed from the frozen list.'connector' = 'datagen'(e.g.DataGeneratorConnectorITCase,SqlGatewayServiceITCase,AbstractMaterializedTableStatementITCase,OpenAIChatModelTest,ProcessTableFunctionTest) continue to pass unchanged.Does this pull request potentially affect one of the following parts:
flink-table-api-java-bridgenow depends onflink-connector-datagen)@Public(Evolving): noDocumentation
Was generative AI tooling used to co-author this PR?
Generated-by: [GitHub Copilot]