Skip to content

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

Open
keshavdandeva wants to merge 3 commits into
mainfrom
bq-fix-npe-on-pcnt-tables
Open

fix(bigquery): support optional fields in BigLakeConfiguration to prevent NPE on Iceberg/Lakehouse tables#13733
keshavdandeva wants to merge 3 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
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.

1 participant