Skip to content

Conversation

@lostluck
Copy link
Contributor

@lostluck lostluck commented Dec 9, 2024

Coder Contexts are largely deprecated as a notion in Beam, and aren't used, with the default being the "nested" coder context instead of the Outer context. There are a few places though that still set "outer coder context" by default, notably in the CoderUtils helper methods.

Where this manifests for TestStream is that CoderUtils is used to take elements and convert them into byte buffers when moved portably. While most coders now ignore the difference, for various legacy reasons, the KVCoder still pipes the context to the value coder, and some coders still understand and use the difference. In this case, the StringUTF8 coder, when given the Outer context, doesn't length prefix the string.

This leads to TestStream values being encoded in weird ways, that don't translate portably. eg. If the values are KV<String, String> the Key will be length prefixed, but the value will not be. This will ultimately cause a break at test run time, because the CoderUtils path isn't used in decoding over Beam Portability, but the normal decoder path, which wouldn't provide the Outer context.

This is likely what's caused difficulty in using TestStream in non-Java SDKs, such as Go on Flink.


Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Mention the appropriate issue in your description (for example: addresses #123), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, comment fixes #<ISSUE NUMBER> instead.
  • Update CHANGES.md with noteworthy changes.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md

GitHub Actions Tests Status (on master branch)

Build python source distribution and wheels
Python tests
Java tests
Go tests

See CI.md for more information about GitHub Actions CI or the workflows README to see a list of phrases to trigger workflows.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 9, 2024

Test Results

15 tests  +14    4 ✅ + 3   26m 3s ⏱️ + 11m 34s
12 suites +11    0 💤 ± 0 
12 files   +11   11 ❌ +11 

For more details on these failures, see this check.

Results for commit f5dc00b. ± Comparison against base commit 2344fdc.

This pull request removes 1 and adds 15 tests. Note that renamed tests count towards both.
apache_beam.examples.streaming_wordcount_it_test.StreamingWordCountIT ‑ test_streaming_wordcount_it
org.apache.beam.examples.complete.AutoCompleteIT ‑ testE2EAutoComplete
org.apache.beam.examples.complete.TfIdfIT ‑ testE2ETfIdf
org.apache.beam.examples.complete.TopWikipediaSessionsIT ‑ testE2ETopWikiPages
org.apache.beam.examples.complete.TrafficMaxLaneFlowIT ‑ testE2ETrafficMaxLaneFlow
org.apache.beam.examples.complete.TrafficRoutesIT ‑ testE2ETrafficRoutes
org.apache.beam.examples.cookbook.BigQueryTornadoesIT ‑ testE2EBigQueryTornadoesWithExport
org.apache.beam.examples.cookbook.BigQueryTornadoesIT ‑ testE2EBigQueryTornadoesWithExportUsingQuery
org.apache.beam.examples.cookbook.BigQueryTornadoesIT ‑ testE2eBigQueryTornadoesWithStorageApi
org.apache.beam.examples.cookbook.BigQueryTornadoesIT ‑ testE2eBigQueryTornadoesWithStorageApiUsingQuery
org.apache.beam.examples.cookbook.CombinePerKeyExamplesIT ‑ testE2ECombinePerKey
…

@github-actions
Copy link
Contributor

github-actions bot commented Dec 9, 2024

Checks are failing. Will not request review until checks are succeeding. If you'd like to override that behavior, comment assign set of reviewers

@lostluck lostluck force-pushed the targettedTestStreamCoder branch from f5dc00b to f2b88e9 Compare December 9, 2024 21:40
@github-actions
Copy link
Contributor

github-actions bot commented Feb 8, 2025

This pull request has been marked as stale due to 60 days of inactivity. It will be closed in 1 week if no further activity occurs. If you think that’s incorrect or this pull request requires a review, please simply write any comment. If closed, you can revive the PR at any time and @mention a reviewer or discuss it on the [email protected] list. Thank you for your contributions.

@github-actions github-actions bot added the stale label Feb 8, 2025
@github-actions
Copy link
Contributor

This pull request has been closed due to lack of activity. If you think that is incorrect, or the pull request requires review, you can revive the PR at any time.

@github-actions github-actions bot closed this Feb 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant