GCP, Azure: ignore null values for optional numeric properties - #17784
Open
waterWang wants to merge 1 commit into
Open
GCP, Azure: ignore null values for optional numeric properties#17784waterWang wants to merge 1 commit into
waterWang wants to merge 1 commit into
Conversation
ebyhr
reviewed
Aug 24, 2026
Comment on lines
+122
to
+123
| this.adlsReadBlockSize = | ||
| PropertyUtil.propertyAsNullableInt(properties, ADLS_READ_BLOCK_SIZE); |
Member
There was a problem hiding this comment.
We can eliminate the if condition above, right?
| } | ||
|
|
||
| @Test | ||
| public void testNullBlockSizesAreIgnored() { |
Member
There was a problem hiding this comment.
https://iceberg.apache.org/contribute/#conventions-and-recommendations
Omit the test prefix for newly added test methods.
Suggested change
| public void testNullBlockSizesAreIgnored() { | |
| public void nullValuesAreIgnored() { |
There is no need to include "BlockSizes" in my opinion. We may add new entries in the future.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
GCPPropertiesandAzurePropertiesthrowNumberFormatExceptionwhen optional numeric properties exist in the properties map withnullvalues.properties.containsKey(...)returnstruefor null-valued entries, butInteger.parseInt(null)/Long.parseLong(null)raisesNumberFormatException: Cannot parse null string.Changes
GCPProperties.java: Replaced
Integer.parseInt(properties.get(...))withPropertyUtil.propertyAsNullableIntforGCS_CHANNEL_READ_CHUNK_SIZEandGCS_CHANNEL_WRITE_CHUNK_SIZE. ReplacedLong.parseLong(properties.get(...))withPropertyUtil.propertyAsNullableLongforGCS_OAUTH2_TOKEN_EXPIRES_AT, with a null guard before thenew Date(...)call.AzureProperties.java: Replaced
Integer.parseInt(properties.get(...))withPropertyUtil.propertyAsNullableIntforADLS_READ_BLOCK_SIZE. ReplacedLong.parseLong(properties.get(...))withPropertyUtil.propertyAsNullableLongforADLS_WRITE_BLOCK_SIZE.TestGCPProperties.java: Added
testNullNumericPropertiesAreIgnoredto verify null values are treated as absent.TestAzureProperties.java: Added
testNullBlockSizesAreIgnoredto verify null values are treated as absent.Fixes #17771