Skip to content

Fix(java/sql): Fix NullPointerException in TextTableProvider for Java 17#35476

Closed
liferoad wants to merge 1 commit intoapache:masterfrom
liferoad:fix-sql-java17
Closed

Fix(java/sql): Fix NullPointerException in TextTableProvider for Java 17#35476
liferoad wants to merge 1 commit intoapache:masterfrom
liferoad:fix-sql-java17

Conversation

@liferoad
Copy link
Contributor

The TextTableProvider was failing with a NullPointerException when using the JSON format on java 17:

> Task :sdks:java:extensions:sql:test

org.apache.beam.sdk.extensions.sql.meta.provider.text.TextTableProviderTest > testJson FAILED
    org.apache.beam.sdk.extensions.sql.impl.ParseException at TextTableProviderTest.java:224
        Caused by: org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.tools.ValidationException at TextTableProviderTest.java:224
            Caused by: java.lang.NullPointerException at TextTableProviderTest.java:224

org.apache.beam.sdk.extensions.sql.meta.provider.text.TextTableProviderTest > testWriteJson FAILED
    org.apache.beam.sdk.extensions.sql.impl.ParseException at TextTableProviderTest.java:305
        Caused by: org.apache.beam.vendor.calcite.v1_28_0.org.apache.calcite.tools.ValidationException at TextTableProviderTest.java:305
            Caused by: java.lang.NullPointerException at TextTableProviderTest.java:305

Overriding the buildIOWriter method in TextJsonTable to correctly handle writing JSON files.


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

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

@liferoad liferoad requested a review from Abacn June 30, 2025 20:24
@github-actions
Copy link
Contributor

Assigning reviewers:

R: @chamikaramj for label java.

Note: If you would like to opt out of this review, comment assign to next reviewer.

Available commands:

  • stop reviewer notifications - opt out of the automated review tooling
  • remind me after tests pass - tag the comment author after tests pass
  • waiting on author - shift the attention set back to the author (any comment or push by the author will return the attention set to the reviewers)

The PR bot will only process comments in the main thread (not review comments).

Copy link
Contributor

@Abacn Abacn left a comment

Choose a reason for hiding this comment

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

The tests has been exercised on Java17 and passed. I also ran locally (with Java17 solely) ./gradlew :sdks:java:extensions:sql:test --tests org.apache.beam.sdk.extensions.sql.meta.provider.text.TextTableProviderTest test also passed. I'm using Temurin-17.0.8+7

Observed test failures might be due to unrelated issue like gradle cache etc

@liferoad
Copy link
Contributor Author

liferoad commented Jul 1, 2025

@damccorm also confirmed the tests work with his Java 17. Let me close this for now.

@liferoad liferoad closed this Jul 1, 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.

2 participants