danny0405 commented on code in PR #18877:
URL: https://github.com/apache/hudi/pull/18877#discussion_r3433244365
##########
hudi-client/hudi-flink-client/src/main/java/org/apache/hudi/io/storage/row/parquet/ParquetRowDataWriter.java:
##########
@@ -64,16 +69,19 @@ public class ParquetRowDataWriter {
public ParquetRowDataWriter(
RecordConsumer recordConsumer,
- RowType rowType,
- GroupType schema,
- boolean utcTimestamp) {
+ boolean utcTimestamp,
+ HoodieSchema hoodieSchema) {
this.recordConsumer = recordConsumer;
this.utcTimestamp = utcTimestamp;
+ RowType rowType = HoodieSchemaConverter.convertToRowType(hoodieSchema);
this.filedWriters = new FieldWriter[rowType.getFieldCount()];
this.fieldNames = rowType.getFieldNames().toArray(new String[0]);
for (int i = 0; i < rowType.getFieldCount(); i++) {
- this.filedWriters[i] = createWriter(rowType.getTypeAt(i));
+ String fieldName = fieldNames[i];
+ HoodieSchema fieldSchema =
hoodieSchema.getNonNullType().getField(fieldName).map(HoodieSchemaField::schema)
Review Comment:
Can we add a util in hoodie schema to return the schema or throws, I see
similar pattern in several places.
--
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]