abhioncbr commented on code in PR #10656: URL: https://github.com/apache/pinot/pull/10656#discussion_r1207501501
########## pinot-common/src/main/java/org/apache/pinot/common/utils/config/TableConfigUtils.java: ########## @@ -444,4 +446,36 @@ public static boolean hasPreConfiguredInstancePartitions(TableConfig tableConfig return hasPreConfiguredInstancePartitions(tableConfig) && tableConfig.getInstancePartitionsMap().containsKey(instancePartitionsType); } + + /** + * Get the partition column from tableConfig instance assignment config map. + * @param tableConfig table config + * @return partition column + */ + public static String getPartitionColumn(TableConfig tableConfig) { + String partitionColumn = null; + + // check getInstanceAssignmentConfigMap is null or empty, + if (!MapUtils.isEmpty(tableConfig.getInstanceAssignmentConfigMap())) { + for (Map.Entry<String, InstanceAssignmentConfig> entry: tableConfig.getInstanceAssignmentConfigMap().entrySet()) { + InstanceAssignmentConfig instanceAssignmentConfig = entry.getValue(); + //check InstanceAssignmentConfig has the InstanceReplicaGroupPartitionConfig with non-empty partitionColumn + if (StringUtils.isNotEmpty(instanceAssignmentConfig.getReplicaGroupPartitionConfig().getPartitionColumn())) { + // if true, set the partitionColumn value. + partitionColumn = instanceAssignmentConfig.getReplicaGroupPartitionConfig().getPartitionColumn(); + } + } + } + + // check, if partitionColumn is not empty, return the value. + if (!StringUtils.isEmpty(partitionColumn)) { + return partitionColumn; + } Review Comment: Thanks, changing it as per the suggestion. -- 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-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org