prodeezy commented on a change in pull request #498: Adding partition transform
builder methods to set custom target field names
URL: https://github.com/apache/incubator-iceberg/pull/498#discussion_r328753324
##########
File path: api/src/main/java/org/apache/iceberg/PartitionSpec.java
##########
@@ -357,76 +357,100 @@ public Builder withSpecId(int newSpecId) {
return sourceColumn;
}
- public Builder identity(String sourceName) {
- checkAndAddPartitionName(sourceName);
+
+ public Builder identity(String sourceName, String targetName) {
+ checkAndAddPartitionName(targetName);
Types.NestedField sourceColumn = findSourceColumn(sourceName);
fields.add(new PartitionField(
- sourceColumn.fieldId(), sourceName,
Transforms.identity(sourceColumn.type())));
+ sourceColumn.fieldId(), targetName,
Transforms.identity(sourceColumn.type())));
return this;
}
- public Builder year(String sourceName) {
- String name = sourceName + "_year";
- checkAndAddPartitionName(name);
+ public Builder identity(String sourceName) {
+ return identity(sourceName, sourceName);
+ }
+
+ public Builder year(String sourceName, String targetName) {
+
Review comment:
done
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]