clusterService, transportPutIndexTemplateAction, true).build();
assert info.isPartitioned();
int i = 0;
int numPartitionedColumns = info.partitionedByColumns().size();
PartitionName partitionName;
try {
partitionName = PartitionName.fromString(
index.name(),
tableName);
} catch (IllegalArgumentException e) {
throw new UnhandledServerException(
String.format(Locale.ENGLISH,
"Unable to load PARTITIONED BY columns from partition %s",
index.name()),
e
);
}
assert partitionName.values().size() == numPartitionedColumns : "invalid number of partitioned columns";
for (ReferenceInfo partitionedInfo : info.partitionedByColumns()) {
builder.put(partitionedInfo.ident(), new PartitionedColumnExpression(
partitionedInfo,
partitionName.values().get(i)
));
i++;
}
} else {
logger.error("Orphaned partition '{}' with missing table '{}' found",