Skip to content

[FLINK-40048][e2e] Replace Kafka with filesystem connector in SqlClientITCase#28606

Merged
MartijnVisser merged 2 commits into
apache:masterfrom
MartijnVisser:FLINK-40048-sql-client-refactor
Jul 3, 2026
Merged

[FLINK-40048][e2e] Replace Kafka with filesystem connector in SqlClientITCase#28606
MartijnVisser merged 2 commits into
apache:masterfrom
MartijnVisser:FLINK-40048-sql-client-refactor

Conversation

@MartijnVisser

Copy link
Copy Markdown
Contributor

What is the purpose of the change

SqlClientITCase#testMatchRecognize has been @Disabled since the Kafka connector was externalized (FLINK-30859) and was never re-enabled. The module still carried flink-sql-connector-kafka:3.0.0-1.17 (a Flink 1.17-era version of the externalized connector), kafka-clients, and testcontainers-kafka, and started a Kafka container on every test class, all for a test that never ran. This also caused recurring maintenance such as kafka-clients version bumps (see #27924).

This PR re-enables the test using the built-in filesystem connector, preserving the original intent (SQL Client submission of a streaming job with event-time watermarks and MATCH_RECOGNIZE), and removes the dead Kafka infrastructure.

Brief change log

  • Rewrite testMatchRecognize to read the 8 test records from a JSON Lines file staged into the JobManager container (the SourceCoordinator enumerates splits there) and each TaskManager container, using the filesystem connector in explicit streaming mode; remove @Disabled.
  • Rework verifyNumberOfResultRecords: wait for the bounded job to reach FINISHED via RestClusterClient and read the sink output once, instead of polling the result file in an unbounded loop that swallowed job failures. The sink flushes all records at the latest when the bounded job finishes, so a failing job now surfaces immediately with its actual state.
  • Drop the dead RegReplace function registration: its invocation moved to the Kafka-specific script in FLINK-10624 (2018), and CREATE FUNCTION register-and-invoke coverage lives in flink-end-to-end-tests-sql (UsingRemoteJarITCase, CreateTableAsITCase, PlannerScalaFreeITCase), which still consumes the SqlToolbox.jar built by this module.
  • Remove flink-sql-connector-kafka, kafka-clients, and testcontainers-kafka from the pom, including the dependencyManagement pin and the sql-jars copy entry; keep commons-codec (needed by FlinkImageBuilder).

Verifying this change

This change is covered by the module's own E2E tests: all 3 tests in SqlClientITCase pass locally under -Prun-end-to-end-tests (~75s total), including the re-enabled testMatchRecognize, which was additionally run 3 more times in isolation to check stability.

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): no (removes test-only dependencies; no NOTICE impact)
  • 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 (test-only change)
  • The S3 file system connector: no

Documentation

  • Does this pull request introduce a new feature? no

Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)

Generated-by: Claude Code (Sonnet 4.6)

…ntITCase

testMatchRecognize has been @disabled since the Kafka connector was
externalized (FLINK-30859), leaving kafka-clients, the 1.17-era
flink-sql-connector-kafka and a KafkaContainer behind for no active
test while still requiring dependency upgrades.

Read the test records from a file staged into the JobManager and
TaskManager containers instead, and re-enable the test. Verify results
by waiting for the bounded job to reach FINISHED rather than polling
the sink file in an unbounded loop that swallowed job failures.

Also drop the RegReplace function registration: its invocation moved to
the Kafka-specific script in FLINK-10624 and CREATE FUNCTION is covered
by the flink-end-to-end-tests-sql module, which still consumes the
SqlToolbox.jar built here.

Generated-by: Claude Code (Sonnet 4.6)
@flinkbot

flinkbot commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

@spuru9 spuru9 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

"{\"timestamp\": \"2018-03-12T10:40:00Z\", \"user\": \"Bob\", \"event\": { \"type\": \"ERROR\", \"message\": \"This is an error.\"}}"
};
sendMessages("test-json", messages);
File inputFile = new File(tempDir, "test-json.jsonl");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is jsonl?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JSON Lines, a specific format where each line contains one JSON object, separated by a newline character

Comment thread flink-end-to-end-tests/flink-sql-client-test/src/test/java/SqlClientITCase.java Outdated
Comment thread flink-end-to-end-tests/flink-sql-client-test/src/test/java/SqlClientITCase.java Outdated
@github-actions github-actions Bot added the community-reviewed PR has been reviewed by the community. label Jul 2, 2026
Generated-by: Claude Code (Fable 5)

@snuyanzin snuyanzin left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm % green ci

@MartijnVisser MartijnVisser merged commit 4859b98 into apache:master Jul 3, 2026
@MartijnVisser MartijnVisser deleted the FLINK-40048-sql-client-refactor branch July 3, 2026 05:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-reviewed PR has been reviewed by the community.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants