You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "vinothchandar (via GitHub)" <gi...@apache.org> on 2026/07/14 04:11:34 UTC

[PR] refactor(common): utils consolidation sweep remnants [hudi]

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

   ### Describe the issue this Pull Request addresses
   
   Follow-ups from the `*Utils` consolidation sweep (#19212): small remaining duplications and a misleading naming inversion that were identified during that PR's review but deferred to keep it scoped.
   
   ### Summary and Changelog
   
   Behavior-preserving cleanup; no user-facing change:
   
   - **`SecondaryIndexKeyUtils`**: rename `getUnescapedSecondaryKey[Prefix]FromSecondaryIndexKey` → `getEscapedSecondaryKey[Prefix]FromSecondaryIndexKey`. Both methods return the still-encoded key segment (the caller that actually decodes applies `unescapeSpecialChars` on top), so the old names stated the opposite of the behavior; the new names match the existing `getEscapedSecondaryKeyPrefixFromSecondaryKey` convention.
   - **`HoodieHiveUtils#getNthParent`**: deleted — byte-identical to `TablePathUtils`' private walker. The latter is now public and the one remaining caller (`HoodieROTablePathFilter`) uses it.
   - **`CommonClientUtils#generateWriteToken`**: folded into `FSUtils` as a `makeWriteToken(TaskContextSupplier)` overload next to its 3-arg sibling; single caller (`RollbackHelperV1`) migrated.
   
   Also completed the review follow-up audit of all `HoodieAvroUtils#unwrapNullable` call sites for multi-member-union exposure: no reachable mis-resolution (variant-shredding sites use internally-constructed schemas; the one arbitrary-schema site, `projectFields`, discards the unwrapped result or validates RECORD and throws). Documented; no code change needed.
   
   ### Impact
   
   None on public APIs or user-facing behavior. Renamed methods are internal metadata-index utils; all callers and tests migrated.
   
   ### Risk Level
   
   Low. Verified with checkstyle/scalastyle gates enabled plus the affected test classes: `TestSecondaryIndexKeyUtils` (86 tests), `TestTablePathUtils`, `TestFSUtils`, `TestHoodieTableMetadataUtil` — all green.
   
   ### Documentation Update
   
   None.
   
   ### Contributor's checklist
   
   - [x] Read through [contributor's guide](https://hudi.apache.org/contribute/how-to-contribute)
   - [x] Enough context is provided in the sections above
   - [x] Adequate tests were added if applicable
   


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


Re: [PR] refactor(common): utils consolidation sweep remnants [hudi]

Posted by "vinothchandar (via GitHub)" <gi...@apache.org>.
vinothchandar commented on PR #19284:
URL: https://github.com/apache/hudi/pull/19284#issuecomment-4995418715

   @bhasudha Can you skim this quickly


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


Re: [PR] refactor(common): utils consolidation sweep remnants [hudi]

Posted by "bhasudha (via GitHub)" <gi...@apache.org>.
bhasudha merged PR #19284:
URL: https://github.com/apache/hudi/pull/19284


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


Re: [PR] refactor(common): utils consolidation sweep remnants [hudi]

Posted by "vinothchandar (via GitHub)" <gi...@apache.org>.
vinothchandar commented on code in PR #19284:
URL: https://github.com/apache/hudi/pull/19284#discussion_r3598056324


##########
hudi-common/src/main/java/org/apache/hudi/metadata/HoodieTableMetadataUtil.java:
##########
@@ -940,7 +940,7 @@ private static List<FileAndPartitionFlag> fetchPartitionFileInfo(
   public static SerializableBiFunction<String, Integer, Integer> getSecondaryKeyToFileGroupMappingFunction(boolean needsSecondaryKeyExtraction) {
     if (needsSecondaryKeyExtraction) {
       return (recordKey, numFileGroups) -> {
-        String secondaryKey = SecondaryIndexKeyUtils.getUnescapedSecondaryKeyPrefixFromSecondaryIndexKey(recordKey);
+        String secondaryKey = SecondaryIndexKeyUtils.getEscapedSecondaryKeyPrefixFromSecondaryIndexKey(recordKey);

Review Comment:
   this is just a method rename



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


Re: [PR] refactor(common): utils consolidation sweep remnants [hudi]

Posted by "vinothchandar (via GitHub)" <gi...@apache.org>.
vinothchandar closed pull request #19284: refactor(common): utils consolidation sweep remnants
URL: https://github.com/apache/hudi/pull/19284


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


Re: [PR] refactor(common): utils consolidation sweep remnants [hudi]

Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #19284:
URL: https://github.com/apache/hudi/pull/19284#issuecomment-4965342051

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "d55b6737158ba13236571d9c6317bbbc201ef1b7",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "d55b6737158ba13236571d9c6317bbbc201ef1b7",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * d55b6737158ba13236571d9c6317bbbc201ef1b7 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