bowenli86 commented on a change in pull request #8703:
[FLINK-12807][hive]Support Hive table columnstats related operations in
HiveCatalog
URL: https://github.com/apache/flink/pull/8703#discussion_r293926968
##########
File path:
flink-connectors/flink-connector-hive/src/main/java/org/apache/flink/table/catalog/hive/HiveCatalog.java
##########
@@ -1116,11 +1117,14 @@ public void alterPartitionColumnStatistics(ObjectPath
tablePath, CatalogPartitio
private String getPartitionName(ObjectPath tablePath,
CatalogPartitionSpec partitionSpec, Table hiveTable) throws
PartitionSpecInvalidException {
List<String> partitionCols =
getFieldNames(hiveTable.getPartitionKeys());
List<String> partitionVals =
getOrderedFullPartitionValues(partitionSpec, partitionCols, tablePath);
- List<String> partKVs = new ArrayList<>();
+ StringBuilder stringBuilder = new StringBuilder();
for (int i = 0; i < partitionCols.size(); i++) {
- partKVs.add(partitionCols.get(i) + "=" +
partitionVals.get(i));
+
stringBuilder.append(partitionCols.get(i)).append("=").append(partitionVals.get(i));
+ if (i < partitionCols.size() - 1) {
+ stringBuilder.append("/");
+ }
}
- return org.apache.commons.lang3.StringUtils.join(partKVs, "/");
Review comment:
we can keep the `List<String> partKVs` and just call `return
String.join("/", partKVs)` at the end
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services