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 2020/11/05 18:34:22 UTC

[GitHub] [hudi] zhedoubushishi opened a new pull request #2232: [HUDI-1375] Fix bug for HoodieAvroUtils.removeMetadataFields() method

zhedoubushishi opened a new pull request #2232:
URL: https://github.com/apache/hudi/pull/2232


   ## *Tips*
   - *Thank you very much for contributing to Apache Hudi.*
   - *Please review https://hudi.apache.org/contributing.html before opening a pull request.*
   
   ## What is the purpose of the pull request
   
   JIRA https://issues.apache.org/jira/browse/HUDI-1375
   
   This CR fix the bug in HoodieAvroUtils.removeMetadataFields() method.
   
   The root cause for this bug is when using Schema$RecordSchema.setFields(), it requires the position of each field must be -1: https://github.com/apache/avro/blob/master/lang/java/avro/src/main/java/org/apache/avro/Schema.java#L908. But filteredFields already set the position in each field. So that's why it throws the exception.
   
   Looks like we cannot manually reset the position to -1. But when initializing a new Field, the position by default will be -1. So we can create a new field with the same value as before.
   
   ## Brief change log
   
   Fix bug and add a test case to cover.
   
   ## Verify this pull request
   
   This change added tests and can be verified as follows:
   
   - w/o the code change in ```HoodieAvroUtils.java```, the unit test won't pass:
   
   ```
   [INFO] Results:
   [INFO] 
   [ERROR] Errors: 
   [ERROR]   TestHoodieAvroUtils.testAddingAndRemovingMetadataFields:207 » AvroRuntime Fiel...
   [INFO] 
   [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0
   
   ```
   - with the code change in  ```HoodieAvroUtils.java```, the unit test could pass:
   
   ```
   [INFO]  T E S T S
   [INFO] -------------------------------------------------------
   [INFO] Running org.apache.hudi.avro.TestHoodieAvroUtils
   [INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.346 s - in org.apache.hudi.avro.TestHoodieAvroUtils
   [INFO] 
   [INFO] Results:
   [INFO] 
   [INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
   
   ```
   
   ## Committer checklist
   
    - [x] Has a corresponding JIRA in PR title & commit
    
    - [x] 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.

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



[GitHub] [hudi] codecov-io edited a comment on pull request #2232: [HUDI-1375] Fix bug for HoodieAvroUtils.removeMetadataFields() method

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #2232:
URL: https://github.com/apache/hudi/pull/2232#issuecomment-722731311


   # [Codecov](https://codecov.io/gh/apache/hudi/pull/2232?src=pr&el=h1) Report
   > Merging [#2232](https://codecov.io/gh/apache/hudi/pull/2232?src=pr&el=desc) into [master](https://codecov.io/gh/apache/hudi/commit/33ec88fc3840c47a54b5862e4d276889c4121231?el=desc) will **increase** coverage by `0.02%`.
   > The diff coverage is `100.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/hudi/pull/2232/graphs/tree.svg?width=650&height=150&src=pr&token=VTTXabwbs2)](https://codecov.io/gh/apache/hudi/pull/2232?src=pr&el=tree)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #2232      +/-   ##
   ============================================
   + Coverage     53.50%   53.53%   +0.02%     
   - Complexity     2767     2770       +3     
   ============================================
     Files           348      348              
     Lines         16098    16099       +1     
     Branches       1642     1642              
   ============================================
   + Hits           8614     8619       +5     
   + Misses         6789     6785       -4     
     Partials        695      695              
   ```
   
   | Flag | Coverage Δ | Complexity Δ | |
   |---|---|---|---|
   | hudicli | `38.37% <ø> (ø)` | `0.00 <ø> (ø)` | |
   | hudiclient | `100.00% <ø> (ø)` | `0.00 <ø> (ø)` | |
   | hudicommon | `55.31% <100.00%> (+0.05%)` | `0.00 <1.00> (ø)` | |
   | hudihadoopmr | `32.94% <ø> (ø)` | `0.00 <ø> (ø)` | |
   | hudispark | `65.58% <ø> (ø)` | `0.00 <ø> (ø)` | |
   | huditimelineservice | `65.30% <ø> (ø)` | `0.00 <ø> (ø)` | |
   | hudiutilities | `70.09% <ø> (ø)` | `0.00 <ø> (ø)` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/hudi/pull/2232?src=pr&el=tree) | Coverage Δ | Complexity Δ | |
   |---|---|---|---|
   | [...ain/java/org/apache/hudi/avro/HoodieAvroUtils.java](https://codecov.io/gh/apache/hudi/pull/2232/diff?src=pr&el=tree#diff-aHVkaS1jb21tb24vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvYXZyby9Ib29kaWVBdnJvVXRpbHMuamF2YQ==) | `49.50% <100.00%> (+3.69%)` | `35.00 <1.00> (+4.00)` | |
   | [...ache/hudi/common/fs/inline/InMemoryFileSystem.java](https://codecov.io/gh/apache/hudi/pull/2232/diff?src=pr&el=tree#diff-aHVkaS1jb21tb24vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvY29tbW9uL2ZzL2lubGluZS9Jbk1lbW9yeUZpbGVTeXN0ZW0uamF2YQ==) | `79.31% <0.00%> (-10.35%)` | `15.00% <0.00%> (-1.00%)` | |
   


----------------------------------------------------------------
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.

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



[GitHub] [hudi] codecov-io edited a comment on pull request #2232: [HUDI-1375] Fix bug for HoodieAvroUtils.removeMetadataFields() method

Posted by GitBox <gi...@apache.org>.
codecov-io edited a comment on pull request #2232:
URL: https://github.com/apache/hudi/pull/2232#issuecomment-722731311


   # [Codecov](https://codecov.io/gh/apache/hudi/pull/2232?src=pr&el=h1) Report
   > Merging [#2232](https://codecov.io/gh/apache/hudi/pull/2232?src=pr&el=desc) into [master](https://codecov.io/gh/apache/hudi/commit/33ec88fc3840c47a54b5862e4d276889c4121231?el=desc) will **increase** coverage by `0.02%`.
   > The diff coverage is `100.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/hudi/pull/2232/graphs/tree.svg?width=650&height=150&src=pr&token=VTTXabwbs2)](https://codecov.io/gh/apache/hudi/pull/2232?src=pr&el=tree)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #2232      +/-   ##
   ============================================
   + Coverage     53.50%   53.53%   +0.02%     
   - Complexity     2767     2770       +3     
   ============================================
     Files           348      348              
     Lines         16098    16099       +1     
     Branches       1642     1642              
   ============================================
   + Hits           8614     8619       +5     
   + Misses         6789     6785       -4     
     Partials        695      695              
   ```
   
   | Flag | Coverage Δ | Complexity Δ | |
   |---|---|---|---|
   | hudicli | `38.37% <ø> (ø)` | `0.00 <ø> (ø)` | |
   | hudiclient | `100.00% <ø> (ø)` | `0.00 <ø> (ø)` | |
   | hudicommon | `55.31% <100.00%> (+0.05%)` | `0.00 <1.00> (ø)` | |
   | hudihadoopmr | `32.94% <ø> (ø)` | `0.00 <ø> (ø)` | |
   | hudispark | `65.58% <ø> (ø)` | `0.00 <ø> (ø)` | |
   | huditimelineservice | `65.30% <ø> (ø)` | `0.00 <ø> (ø)` | |
   | hudiutilities | `70.09% <ø> (ø)` | `0.00 <ø> (ø)` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/hudi/pull/2232?src=pr&el=tree) | Coverage Δ | Complexity Δ | |
   |---|---|---|---|
   | [...ain/java/org/apache/hudi/avro/HoodieAvroUtils.java](https://codecov.io/gh/apache/hudi/pull/2232/diff?src=pr&el=tree#diff-aHVkaS1jb21tb24vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvYXZyby9Ib29kaWVBdnJvVXRpbHMuamF2YQ==) | `49.50% <100.00%> (+3.69%)` | `35.00 <1.00> (+4.00)` | |
   | [...ache/hudi/common/fs/inline/InMemoryFileSystem.java](https://codecov.io/gh/apache/hudi/pull/2232/diff?src=pr&el=tree#diff-aHVkaS1jb21tb24vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvY29tbW9uL2ZzL2lubGluZS9Jbk1lbW9yeUZpbGVTeXN0ZW0uamF2YQ==) | `79.31% <0.00%> (-10.35%)` | `15.00% <0.00%> (-1.00%)` | |
   


----------------------------------------------------------------
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.

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



[GitHub] [hudi] codecov-io commented on pull request #2232: [HUDI-1375] Fix bug for HoodieAvroUtils.removeMetadataFields() method

Posted by GitBox <gi...@apache.org>.
codecov-io commented on pull request #2232:
URL: https://github.com/apache/hudi/pull/2232#issuecomment-722731311


   # [Codecov](https://codecov.io/gh/apache/hudi/pull/2232?src=pr&el=h1) Report
   > Merging [#2232](https://codecov.io/gh/apache/hudi/pull/2232?src=pr&el=desc) into [master](https://codecov.io/gh/apache/hudi/commit/33ec88fc3840c47a54b5862e4d276889c4121231?el=desc) will **increase** coverage by `0.02%`.
   > The diff coverage is `100.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/hudi/pull/2232/graphs/tree.svg?width=650&height=150&src=pr&token=VTTXabwbs2)](https://codecov.io/gh/apache/hudi/pull/2232?src=pr&el=tree)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #2232      +/-   ##
   ============================================
   + Coverage     53.50%   53.53%   +0.02%     
   - Complexity     2767     2770       +3     
   ============================================
     Files           348      348              
     Lines         16098    16099       +1     
     Branches       1642     1642              
   ============================================
   + Hits           8614     8619       +5     
   + Misses         6789     6785       -4     
     Partials        695      695              
   ```
   
   | Flag | Coverage Δ | Complexity Δ | |
   |---|---|---|---|
   | hudicli | `38.37% <ø> (ø)` | `0.00 <ø> (ø)` | |
   | hudiclient | `100.00% <ø> (ø)` | `0.00 <ø> (ø)` | |
   | hudicommon | `55.31% <100.00%> (+0.05%)` | `0.00 <1.00> (ø)` | |
   | hudihadoopmr | `32.94% <ø> (ø)` | `0.00 <ø> (ø)` | |
   | hudispark | `65.58% <ø> (ø)` | `0.00 <ø> (ø)` | |
   | huditimelineservice | `65.30% <ø> (ø)` | `0.00 <ø> (ø)` | |
   | hudiutilities | `70.09% <ø> (ø)` | `0.00 <ø> (ø)` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/hudi/pull/2232?src=pr&el=tree) | Coverage Δ | Complexity Δ | |
   |---|---|---|---|
   | [...ain/java/org/apache/hudi/avro/HoodieAvroUtils.java](https://codecov.io/gh/apache/hudi/pull/2232/diff?src=pr&el=tree#diff-aHVkaS1jb21tb24vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvYXZyby9Ib29kaWVBdnJvVXRpbHMuamF2YQ==) | `49.50% <100.00%> (+3.69%)` | `35.00 <1.00> (+4.00)` | |
   | [...ache/hudi/common/fs/inline/InMemoryFileSystem.java](https://codecov.io/gh/apache/hudi/pull/2232/diff?src=pr&el=tree#diff-aHVkaS1jb21tb24vc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2h1ZGkvY29tbW9uL2ZzL2lubGluZS9Jbk1lbW9yeUZpbGVTeXN0ZW0uamF2YQ==) | `79.31% <0.00%> (-10.35%)` | `15.00% <0.00%> (-1.00%)` | |
   


----------------------------------------------------------------
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.

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



[GitHub] [hudi] umehrot2 merged pull request #2232: [HUDI-1375] Fix bug for HoodieAvroUtils.removeMetadataFields() method

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


   


----------------------------------------------------------------
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.

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