Skip to content

Commit 39f5e1a

Browse files
author
vnarayanan
committed
Fix minor typo
1 parent d95212f commit 39f5e1a

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/utils/MetaStoreServerUtils.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1616,13 +1616,11 @@ public static String getPartitionName(Path tablePath, Path partitionPath, Set<St
16161616
throw new MetastoreException("Path " + relPath + "doesn't match custom partition pattern " + customPathPattern + "partitionPathFull: " + partitionPath);
16171617
}
16181618
StringBuilder resultBuilder = new StringBuilder();
1619-
for (int i = 0; i < patternPartCols.size(); i++) {
1620-
if (result == null) {
1621-
resultBuilder.append(patternPartCols.get(i)).append("=").append(pathMatcher.group(i + 1));
1622-
}
1623-
else {
1624-
resultBuilder.append(Path.SEPARATOR).append(patternPartCols.get(i)).append("=").append(pathMatcher.group(i+1));
1625-
}
1619+
if (patternPartCols.size() > 0) {
1620+
resultBuilder.append(patternPartCols.get(0)).append("=").append(pathMatcher.group(1));
1621+
}
1622+
for (int i = 1; i < patternPartCols.size(); i++) {
1623+
resultBuilder.append(Path.SEPARATOR).append(patternPartCols.get(i)).append("=").append(pathMatcher.group(i+1));
16261624
}
16271625
result = resultBuilder.toString();
16281626
}

0 commit comments

Comments
 (0)