Skip to content

fix(bigquery): support optional fields in BigLakeConfiguration to prevent NPE on Iceberg/Lakehouse tables#13733

Merged
keshavdandeva merged 7 commits into
mainfrom
bq-fix-npe-on-pcnt-tables
Jul 17, 2026
Merged

fix(bigquery): support optional fields in BigLakeConfiguration to prevent NPE on Iceberg/Lakehouse tables#13733
keshavdandeva merged 7 commits into
mainfrom
bq-fix-npe-on-pcnt-tables

Conversation

@keshavdandeva

Copy link
Copy Markdown
Contributor

b/534291682

This PR resolves a NullPointerException encountered when querying or retrieving metadata for 4-part PCNT (Project.Catalog.Namespace.Table) Apache Iceberg tables governed by external REST catalogs.

Changes

  • Annotated all 4 fields (connectionId, fileFormat, storageUri, tableFormat) and their corresponding setters in @AutoValue.Builder with @Nullable in BigLakeConfiguration.java.
  • Cleaned up the Javadoc comments for the builder setters in BigLakeConfiguration.java to remove incorrect [Required] notations and updated getTableFormat() Javadoc to reflect the correct table format reference (e.g., Iceberg) instead of file format.
  • Added unit test coverage to BigLakeConfigurationTest.java (testNullFields, testFromPbWithNullFields) to verify that constructing the configuration or mapping it from API models works successfully when properties are null.

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request updates BigLakeConfiguration to allow nullable fields, adding @Nullable annotations to the getters and builder setters, and removing the "[Required]" designation from the builder's Javadocs. It also adds unit tests to verify behavior when fields are null. The review feedback identifies copy-paste errors in the Javadocs for getTableFormat() and setTableFormat(), which incorrectly refer to "file format" and "PARQUET" instead of "table format" and "ICEBERG".

@keshavdandeva

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request updates BigLakeConfiguration by adding @Nullable annotations to its getters and builder setters, updating Javadoc comments, and adding unit tests to verify null field handling. The feedback suggests using the more idiomatic assertNull(value) instead of assertEquals(null, value) in the new test cases.

@keshavdandeva
keshavdandeva marked this pull request as ready for review July 13, 2026 15:13
@keshavdandeva
keshavdandeva requested review from a team as code owners July 13, 2026 15:13
@keshavdandeva
keshavdandeva requested review from logachev and lqiu96 July 13, 2026 15:13

@lqiu96 lqiu96 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. Can you see if we can use JSpecify annotations? If there is some issue with autovalue integration, javax is fine for now as well

@keshavdandeva
keshavdandeva enabled auto-merge (squash) July 17, 2026 13:22
@keshavdandeva keshavdandeva added kokoro:run Add this label to force Kokoro to re-run the tests. kokoro:force-run Add this label to force Kokoro to re-run the tests. and removed kokoro:run Add this label to force Kokoro to re-run the tests. kokoro:force-run Add this label to force Kokoro to re-run the tests. labels Jul 17, 2026
@keshavdandeva

Copy link
Copy Markdown
Contributor Author

/gcbrun

@keshavdandeva
keshavdandeva merged commit e2cca4d into main Jul 17, 2026
213 of 214 checks passed
@keshavdandeva
keshavdandeva deleted the bq-fix-npe-on-pcnt-tables branch July 17, 2026 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants