You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by GitBox <gi...@apache.org> on 2022/03/23 05:26:14 UTC

[GitHub] [hudi] alexeykudinkin opened a new pull request #5102: [HUDI-3684] Fixing NPE in ParquetUtils

alexeykudinkin opened a new pull request #5102:
URL: https://github.com/apache/hudi/pull/5102


   ## *Tips*
   - *Thank you very much for contributing to Apache Hudi.*
   - *Please review https://hudi.apache.org/contribute/how-to-contribute before opening a pull request.*
   
   ## What is the purpose of the pull request
   
   Addresses NPE in `ParquetUtils` not handling `null` min/max statistics
   
   ## Brief change log
   
    - Addressed NPE
    - Tidying up
   
   ## Verify this pull request
   
   This pull request is already covered by existing tests, such as *(please describe tests)*.
   
   ## Committer checklist
   
    - [ ] Has a corresponding JIRA in PR title & commit
    
    - [ ] Commit message is descriptive of the change
    
    - [ ] CI is green
   
    - [ ] Necessary doc changes done or have another open PR
          
    - [ ] For large changes, please consider breaking it into sub-tasks under an umbrella JIRA.
   


-- 
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: commits-unsubscribe@hudi.apache.org

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



[GitHub] [hudi] hudi-bot commented on pull request #5102: [HUDI-3684] Fixing NPE in `ParquetUtils`

Posted by GitBox <gi...@apache.org>.
hudi-bot commented on pull request #5102:
URL: https://github.com/apache/hudi/pull/5102#issuecomment-1075930797


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "8311cb4ae825e75628bbc98a4d9b10bd6e52b59e",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "8311cb4ae825e75628bbc98a4d9b10bd6e52b59e",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 8311cb4ae825e75628bbc98a4d9b10bd6e52b59e UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


-- 
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: commits-unsubscribe@hudi.apache.org

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



[GitHub] [hudi] hudi-bot removed a comment on pull request #5102: [HUDI-3684] Fixing NPE in `ParquetUtils`

Posted by GitBox <gi...@apache.org>.
hudi-bot removed a comment on pull request #5102:
URL: https://github.com/apache/hudi/pull/5102#issuecomment-1075930797


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "8311cb4ae825e75628bbc98a4d9b10bd6e52b59e",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "8311cb4ae825e75628bbc98a4d9b10bd6e52b59e",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 8311cb4ae825e75628bbc98a4d9b10bd6e52b59e UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


-- 
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: commits-unsubscribe@hudi.apache.org

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



[GitHub] [hudi] hudi-bot removed a comment on pull request #5102: [HUDI-3684] Fixing NPE in `ParquetUtils`

Posted by GitBox <gi...@apache.org>.
hudi-bot removed a comment on pull request #5102:
URL: https://github.com/apache/hudi/pull/5102#issuecomment-1075932929


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "8311cb4ae825e75628bbc98a4d9b10bd6e52b59e",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=7217",
       "triggerID" : "8311cb4ae825e75628bbc98a4d9b10bd6e52b59e",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 8311cb4ae825e75628bbc98a4d9b10bd6e52b59e Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=7217) 
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


-- 
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: commits-unsubscribe@hudi.apache.org

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



[GitHub] [hudi] codope commented on a change in pull request #5102: [HUDI-3684] Fixing NPE in `ParquetUtils`

Posted by GitBox <gi...@apache.org>.
codope commented on a change in pull request #5102:
URL: https://github.com/apache/hudi/pull/5102#discussion_r832868782



##########
File path: hudi-common/src/main/java/org/apache/hudi/common/model/HoodieColumnRangeMetadata.java
##########
@@ -18,41 +18,58 @@
 
 package org.apache.hudi.common.model;
 
+import javax.annotation.Nullable;
 import java.io.Serializable;
-import java.util.Arrays;
 import java.util.Comparator;
 import java.util.Objects;
 import java.util.function.BiFunction;
+import java.util.stream.Stream;
 
 /**
- * Hoodie Range metadata.
+ * Hoodie metadata for the column range of data stored in columnar format (like Parquet)
+ *
+ * NOTE: {@link Comparable} is used as raw-type so that we can handle polymorphism, where
+ *        caller apriori is not aware of the type {@link HoodieColumnRangeMetadata} is
+ *        associated with
  */
-public class HoodieColumnRangeMetadata<T> implements Serializable {
+@SuppressWarnings("rawtype")
+public class HoodieColumnRangeMetadata<T extends Comparable> implements Serializable {
   private final String filePath;
   private final String columnName;
+  @Nullable
   private final T minValue;
+  @Nullable
   private final T maxValue;
   private final long nullCount;
   private final long valueCount;
   private final long totalSize;
   private final long totalUncompressedSize;
 
   public static final BiFunction<HoodieColumnRangeMetadata<Comparable>, HoodieColumnRangeMetadata<Comparable>, HoodieColumnRangeMetadata<Comparable>> COLUMN_RANGE_MERGE_FUNCTION =
-      (oldColumnRange, newColumnRange) -> new HoodieColumnRangeMetadata<>(
+      (oldColumnRange, newColumnRange) -> new HoodieColumnRangeMetadata<Comparable>(
           newColumnRange.getFilePath(),
           newColumnRange.getColumnName(),
-          (Comparable) Arrays.asList(oldColumnRange.getMinValue(), newColumnRange.getMinValue())
-              .stream().filter(Objects::nonNull).min(Comparator.naturalOrder()).orElse(null),
-          (Comparable) Arrays.asList(oldColumnRange.getMinValue(), newColumnRange.getMinValue())
-              .stream().filter(Objects::nonNull).max(Comparator.naturalOrder()).orElse(null),
+          (Comparable) Stream.of(oldColumnRange.getMinValue(), newColumnRange.getMinValue())

Review comment:
       Good catch! We should replace `Arrays.asList` by `Stream` if there are other such places.




-- 
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: commits-unsubscribe@hudi.apache.org

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



[GitHub] [hudi] codope merged pull request #5102: [HUDI-3684] Fixing NPE in `ParquetUtils`

Posted by GitBox <gi...@apache.org>.
codope merged pull request #5102:
URL: https://github.com/apache/hudi/pull/5102


   


-- 
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: commits-unsubscribe@hudi.apache.org

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



[GitHub] [hudi] hudi-bot commented on pull request #5102: [HUDI-3684] Fixing NPE in `ParquetUtils`

Posted by GitBox <gi...@apache.org>.
hudi-bot commented on pull request #5102:
URL: https://github.com/apache/hudi/pull/5102#issuecomment-1075932929


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "8311cb4ae825e75628bbc98a4d9b10bd6e52b59e",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=7217",
       "triggerID" : "8311cb4ae825e75628bbc98a4d9b10bd6e52b59e",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 8311cb4ae825e75628bbc98a4d9b10bd6e52b59e Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=7217) 
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


-- 
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: commits-unsubscribe@hudi.apache.org

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



[GitHub] [hudi] hudi-bot commented on pull request #5102: [HUDI-3684] Fixing NPE in `ParquetUtils`

Posted by GitBox <gi...@apache.org>.
hudi-bot commented on pull request #5102:
URL: https://github.com/apache/hudi/pull/5102#issuecomment-1075958844


   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "8311cb4ae825e75628bbc98a4d9b10bd6e52b59e",
       "status" : "CANCELED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=7217",
       "triggerID" : "8311cb4ae825e75628bbc98a4d9b10bd6e52b59e",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 8311cb4ae825e75628bbc98a4d9b10bd6e52b59e Azure: [CANCELED](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=7217) 
   
   <details>
   <summary>Bot commands</summary>
     @hudi-bot supports the following commands:
   
    - `@hudi-bot run azure` re-run the last Azure build
   </details>


-- 
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: commits-unsubscribe@hudi.apache.org

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