yuzelin commented on code in PR #852:
URL: https://github.com/apache/incubator-paimon/pull/852#discussion_r1161530985


##########
paimon-core/src/main/java/org/apache/paimon/utils/PartitionPathUtils.java:
##########
@@ -81,6 +83,36 @@ public static String 
generatePartitionPath(LinkedHashMap<String, String> partiti
         return suffixBuf.toString();
     }
 
+    /**
+     * Generate all hierarchical paths from partition spec.
+     *
+     * <p>For example, if the partition spec is (pt1: '0601', pt2: '12', pt3: 
'30'), this method
+     * will return a list (start from index 0):
+     *
+     * <ul>
+     *   <li>[root]/pt1=0601
+     *   <li>[root]/pt1=0601/pt2=12
+     *   <li>[root]/pt1=0601/pt2=12/pt3=30
+     * </ul>
+     */
+    public static List<String> generateHierarchicalPartitionPaths(
+            LinkedHashMap<String, String> partitionSpec) {
+        List<String> paths = new ArrayList<>();
+        if (partitionSpec.isEmpty()) {
+            paths.add("");

Review Comment:
   It‘s useful for creating bucket path. Similar to 
`PartitionPathUtils#generatePartitionPath`



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to