You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "waterWang (via GitHub)" <gi...@apache.org> on 2026/08/23 09:53:38 UTC

[PR] GCP, Azure: ignore null values for optional numeric properties [iceberg]

waterWang opened a new pull request, #17784:
URL: https://github.com/apache/iceberg/pull/17784

   ### Problem
   
   `GCPProperties` and `AzureProperties` throw `NumberFormatException` when optional numeric properties exist in the properties map with `null` values.
   
   `properties.containsKey(...)` returns `true` for null-valued entries, but `Integer.parseInt(null)` / `Long.parseLong(null)` raises `NumberFormatException: Cannot parse null string`.
   
   ### Changes
   
   - **GCPProperties.java**: Replaced `Integer.parseInt(properties.get(...))` with `PropertyUtil.propertyAsNullableInt` for `GCS_CHANNEL_READ_CHUNK_SIZE` and `GCS_CHANNEL_WRITE_CHUNK_SIZE`. Replaced `Long.parseLong(properties.get(...))` with `PropertyUtil.propertyAsNullableLong` for `GCS_OAUTH2_TOKEN_EXPIRES_AT`, with a null guard before the `new Date(...)` call.
   
   - **AzureProperties.java**: Replaced `Integer.parseInt(properties.get(...))` with `PropertyUtil.propertyAsNullableInt` for `ADLS_READ_BLOCK_SIZE`. Replaced `Long.parseLong(properties.get(...))` with `PropertyUtil.propertyAsNullableLong` for `ADLS_WRITE_BLOCK_SIZE`.
   
   - **TestGCPProperties.java**: Added `testNullNumericPropertiesAreIgnored` to verify null values are treated as absent.
   
   - **TestAzureProperties.java**: Added `testNullBlockSizesAreIgnored` to verify null values are treated as absent.
   
   Fixes #17771


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] GCP, Azure: ignore null values for optional numeric properties [iceberg]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #17784:
URL: https://github.com/apache/iceberg/pull/17784#issuecomment-5805209758

   This pull request has been marked as stale due to 30 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 dev@iceberg.apache.org list. Thank you for your contributions.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] GCP, Azure: ignore null values for optional numeric properties [iceberg]

Posted by "ebyhr (via GitHub)" <gi...@apache.org>.
ebyhr commented on code in PR #17784:
URL: https://github.com/apache/iceberg/pull/17784#discussion_r3840040111


##########
azure/src/main/java/org/apache/iceberg/azure/AzureProperties.java:
##########
@@ -119,10 +119,12 @@ public AzureProperties(Map<String, String> properties) {
     }
 
     if (properties.containsKey(ADLS_READ_BLOCK_SIZE)) {
-      this.adlsReadBlockSize = Integer.parseInt(properties.get(ADLS_READ_BLOCK_SIZE));
+      this.adlsReadBlockSize =
+          PropertyUtil.propertyAsNullableInt(properties, ADLS_READ_BLOCK_SIZE);

Review Comment:
   We can eliminate the `if` condition above, right? 



##########
azure/src/test/java/org/apache/iceberg/azure/TestAzureProperties.java:
##########
@@ -318,4 +319,15 @@ public void initialize(Map<String, String> credentialProperties) {
       properties = credentialProperties;
     }
   }
+
+  @Test
+  public void testNullBlockSizesAreIgnored() {

Review Comment:
   https://iceberg.apache.org/contribute/#conventions-and-recommendations
   > Omit the test prefix for newly added test methods.
   
   ```suggestion
     public void nullValuesAreIgnored() {
   ```
   
   There is no need to include "BlockSizes" in my opinion. We may add new entries in the future. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] GCP, Azure: ignore null values for optional numeric properties [iceberg]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #17784:
URL: https://github.com/apache/iceberg/pull/17784#issuecomment-5922286950

   This pull request has been closed due to lack of activity. This is not a judgement on the merit of the PR in any way. It is just a way of keeping the PR queue manageable. If you think that is incorrect, or the pull request requires review, you can revive the PR at any time.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [PR] GCP, Azure: ignore null values for optional numeric properties [iceberg]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed pull request #17784: GCP, Azure: ignore null values for optional numeric properties
URL: https://github.com/apache/iceberg/pull/17784


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org