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/04/07 12:47:55 UTC

[GitHub] [hudi] codope opened a new pull request, #5252: [HUDI-3454] Fix partition name in all code paths for LogRecordScanner

codope opened a new pull request, #5252:
URL: https://github.com/apache/hudi/pull/5252

   ## What is the purpose of the pull request
   
   HUDI-3454
   There were some paths where we did not init partition while building log record scanner. Fixed all such code paths.
   
   ## Brief change log
   
   - Depend on `FSUtils#getRelativePartitionPath(basePath, logFilePath.getParent)` to get the partition.
   - If the list of log file paths in the split is empty, then fallback to usual behaviour.
   
   ## Verify this pull request
   
   *(Please pick either of the following options)*
   
   This pull request is a trivial rework / code cleanup without any test coverage.
   
   *(or)*
   
   This pull request is already covered by existing tests, such as *(please describe tests)*.
   
   (or)
   
   This change added tests and can be verified as follows:
   
   *(example:)*
   
     - *Added integration tests for end-to-end.*
     - *Added HoodieClientWriteTest to verify the change.*
     - *Manually verified the change by running a job locally.*
   
   ## 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] danny0405 commented on a diff in pull request #5252: [HUDI-3454] Fix partition name in all code paths for LogRecordScanner

Posted by GitBox <gi...@apache.org>.
danny0405 commented on code in PR #5252:
URL: https://github.com/apache/hudi/pull/5252#discussion_r845828970


##########
hudi-common/src/test/java/org/apache/hudi/common/functional/TestHoodieLogFormat.java:
##########
@@ -589,6 +591,7 @@ public void testBasicAppendAndScanMultipleFiles(ExternalSpillableMap.DiskMapType
         .withSpillableMapBasePath(BASE_OUTPUT_PATH)
         .withDiskMapType(diskMapType)
         .withBitCaskDiskMapCompressionEnabled(isCompressionEnabled)
+        .withPartition(getRelativePartitionPath(new Path(basePath), new Path(logFilePaths.get(0)).getParent()))
         .build();

Review Comment:
   Can we inline the fix into the HoodieMergedLogRecordScanner so that there is no need to change these classes ?



-- 
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] alexeykudinkin commented on a diff in pull request #5252: [HUDI-3454] Fix partition name in all code paths for LogRecordScanner

Posted by GitBox <gi...@apache.org>.
alexeykudinkin commented on code in PR #5252:
URL: https://github.com/apache/hudi/pull/5252#discussion_r845536891


##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/table/format/FormatUtils.java:
##########
@@ -144,7 +150,12 @@ public static HoodieMergedLogRecordScanner logScanner(
             config.get(HoodieRealtimeConfig.SPILLABLE_MAP_BASE_PATH_PROP,
                 HoodieRealtimeConfig.DEFAULT_SPILLABLE_MAP_BASE_PATH))
         .withInstantRange(split.getInstantRange())
-        .withOperationField(withOperationField)
+        .withOperationField(withOperationField);
+    if (isNullOrEmpty(logPaths)) {
+      return logRecordScannerBuilder.build();
+    }
+    return logRecordScannerBuilder

Review Comment:
   Please check my comment above



##########
hudi-examples/hudi-examples-flink/src/test/java/org/apache/hudi/examples/quickstart/TestQuickstartData.java:
##########
@@ -358,7 +360,12 @@ private static HoodieMergedLogRecordScanner getScanner(
         .withMaxMemorySizeInBytes(1024 * 1024L)
         .withSpillableMapBasePath("/tmp/")
         .withDiskMapType(HoodieCommonConfig.SPILLABLE_DISK_MAP_TYPE.defaultValue())
-        .withBitCaskDiskMapCompressionEnabled(HoodieCommonConfig.DISK_MAP_BITCASK_COMPRESSION_ENABLED.defaultValue())
+        .withBitCaskDiskMapCompressionEnabled(HoodieCommonConfig.DISK_MAP_BITCASK_COMPRESSION_ENABLED.defaultValue());
+    if (isNullOrEmpty(logPaths)) {
+      return logRecordScannerBuilder.build();

Review Comment:
   nit: For optional building it's preferable to keep the control flow linear instead of bifurcating it and just apply optional actions if needed
   



##########
hudi-cli/src/main/java/org/apache/hudi/cli/commands/HoodieLogFileCommand.java:
##########
@@ -218,6 +220,7 @@ public String showLogFileRecords(
               .withSpillableMapBasePath(HoodieMemoryConfig.SPILLABLE_MAP_BASE_PATH.defaultValue())
               .withDiskMapType(HoodieCommonConfig.SPILLABLE_DISK_MAP_TYPE.defaultValue())
               .withBitCaskDiskMapCompressionEnabled(HoodieCommonConfig.DISK_MAP_BITCASK_COMPRESSION_ENABLED.defaultValue())
+              .withPartition(getRelativePartitionPath(new Path(client.getBasePath()), new Path(logFilePaths.get(0)).getParent()))

Review Comment:
   Let's replace `assert` on line 190 w/ `checkArgument`



-- 
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 #5252: [HUDI-3454] Fix partition name in all code paths for LogRecordScanner

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "0dbfdb5962671aa72db7dd394e89fe759fd94f26",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "0dbfdb5962671aa72db7dd394e89fe759fd94f26",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 0dbfdb5962671aa72db7dd394e89fe759fd94f26 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] danny0405 commented on pull request #5252: [HUDI-3454] Fix partition name in all code paths for LogRecordScanner

Posted by GitBox <gi...@apache.org>.
danny0405 commented on PR #5252:
URL: https://github.com/apache/hudi/pull/5252#issuecomment-1092549772

   Left one comment and see if we can put some improvement here.


-- 
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 #5252: [HUDI-3454] Fix partition name in all code paths for LogRecordScanner

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "0dbfdb5962671aa72db7dd394e89fe759fd94f26",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=7896",
       "triggerID" : "0dbfdb5962671aa72db7dd394e89fe759fd94f26",
       "triggerType" : "PUSH"
     }, {
       "hash" : "871b43397f13ebb5b548f8705ad315ffb76e3117",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=7908",
       "triggerID" : "871b43397f13ebb5b548f8705ad315ffb76e3117",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 0dbfdb5962671aa72db7dd394e89fe759fd94f26 Azure: [SUCCESS](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=7896) 
   * 871b43397f13ebb5b548f8705ad315ffb76e3117 Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=7908) 
   
   <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 #5252: [HUDI-3454] Fix partition name in all code paths for LogRecordScanner

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "0dbfdb5962671aa72db7dd394e89fe759fd94f26",
       "status" : "DELETED",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=7896",
       "triggerID" : "0dbfdb5962671aa72db7dd394e89fe759fd94f26",
       "triggerType" : "PUSH"
     }, {
       "hash" : "871b43397f13ebb5b548f8705ad315ffb76e3117",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=7908",
       "triggerID" : "871b43397f13ebb5b548f8705ad315ffb76e3117",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 871b43397f13ebb5b548f8705ad315ffb76e3117 Azure: [SUCCESS](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=7908) 
   
   <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 #5252: [HUDI-3454] Fix partition name in all code paths for LogRecordScanner

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "0dbfdb5962671aa72db7dd394e89fe759fd94f26",
       "status" : "PENDING",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=7896",
       "triggerID" : "0dbfdb5962671aa72db7dd394e89fe759fd94f26",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 0dbfdb5962671aa72db7dd394e89fe759fd94f26 Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=7896) 
   
   <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 #5252: [HUDI-3454] Fix partition name in all code paths for LogRecordScanner

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "0dbfdb5962671aa72db7dd394e89fe759fd94f26",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=7896",
       "triggerID" : "0dbfdb5962671aa72db7dd394e89fe759fd94f26",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 0dbfdb5962671aa72db7dd394e89fe759fd94f26 Azure: [SUCCESS](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=7896) 
   
   <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 merged pull request #5252: [HUDI-3454] Fix partition name in all code paths for LogRecordScanner

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


-- 
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 #5252: [HUDI-3454] Fix partition name in all code paths for LogRecordScanner

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

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "0dbfdb5962671aa72db7dd394e89fe759fd94f26",
       "status" : "SUCCESS",
       "url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=7896",
       "triggerID" : "0dbfdb5962671aa72db7dd394e89fe759fd94f26",
       "triggerType" : "PUSH"
     }, {
       "hash" : "871b43397f13ebb5b548f8705ad315ffb76e3117",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "871b43397f13ebb5b548f8705ad315ffb76e3117",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 0dbfdb5962671aa72db7dd394e89fe759fd94f26 Azure: [SUCCESS](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=7896) 
   * 871b43397f13ebb5b548f8705ad315ffb76e3117 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