mark-bathori commented on code in PR #7239:
URL: https://github.com/apache/nifi/pull/7239#discussion_r1200458537
##########
nifi-nar-bundles/nifi-iceberg-bundle/nifi-iceberg-processors/src/main/java/org/apache/nifi/processors/iceberg/converter/IcebergRecordConverter.java:
##########
@@ -85,21 +93,25 @@ private static class IcebergSchemaVisitor extends
SchemaWithPartnerVisitor<DataT
case DOUBLE:
case DATE:
case STRING:
- return new GenericDataConverters.SameTypeConverter();
+ return new
GenericDataConverters.PrimitiveTypeConverter(type, dataType);
case TIME:
- return new GenericDataConverters.TimeConverter();
+ return new
GenericDataConverters.TimeConverter(dataType.getFormat());
case TIMESTAMP:
final Types.TimestampType timestampType =
(Types.TimestampType) type;
if (timestampType.shouldAdjustToUTC()) {
- return new
GenericDataConverters.TimestampWithTimezoneConverter();
+ return new
GenericDataConverters.TimestampWithTimezoneConverter(dataType);
}
- return new GenericDataConverters.TimestampConverter();
+ return new
GenericDataConverters.TimestampConverter(dataType);
case UUID:
- final UUIDDataType uuidType = (UUIDDataType) dataType;
- if (uuidType.getFileFormat() == FileFormat.PARQUET) {
+ if (dataType instanceof UUIDDataType) {
+ final UUIDDataType uuidType = (UUIDDataType)
dataType;
+ if (uuidType.getFileFormat() ==
FileFormat.PARQUET) {
+ return new
GenericDataConverters.UUIDtoByteArrayConverter();
+ }
+ } else if (type instanceof Types.UUIDType &&
fileFormat == FileFormat.PARQUET) {
Review Comment:
This seems to duplicate the above logic and passing down the `fileFormat`
down here is also unnecessary.
The `IcebergPartnerAccessors` should be extended to create a `UUIDDataType`
when the target field's type is UUID so this part can be reverted.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]