voonhous commented on code in PR #17743:
URL: https://github.com/apache/hudi/pull/17743#discussion_r2652095891
##########
hudi-client/hudi-spark-client/src/main/java/org/apache/hudi/execution/bulkinsert/RDDBucketIndexPartitioner.java:
##########
@@ -87,7 +87,7 @@ public JavaRDD<HoodieRecord<T>>
doPartition(JavaRDD<HoodieRecord<T>> records, Pa
*/
private JavaRDD<HoodieRecord<T>>
doPartitionAndCustomColumnSort(JavaRDD<HoodieRecord<T>> records, Partitioner
partitioner) {
final String[] sortColumns = sortColumnNames;
- final SerializableSchema schema = new
SerializableSchema(HoodieAvroUtils.addMetadataFields((new
Schema.Parser().parse(table.getConfig().getSchema()))));
+ final SerializableSchema schema = new
SerializableSchema(HoodieSchemaUtils.addMetadataFields((HoodieSchema.parse(table.getConfig().getSchema()))).getAvroSchema());
Review Comment:
HoodieSchema is serializable, we do not need to wrap it around
`SerializableSchema` again.
##########
hudi-client/hudi-spark-client/src/test/java/org/apache/hudi/client/functional/TestExternalPathHandling.java:
##########
@@ -106,7 +108,7 @@ public void testFlow(FileIdAndNameGenerator
fileIdAndNameGenerator, List<String>
.build())
.withArchivalConfig(HoodieArchivalConfig.newBuilder().archiveCommitsWith(1,
2).build())
.withTableServicesEnabled(true)
- .withSchema(simpleSchema.toString())
+ .withSchema(simpleSchema.toAvroSchema().toString())
Review Comment:
Nit: We can use `toString()` here right? `HoodieSchema#toString`'s
implementation is:
```java
public String toString() {
return avroSchema.toString();
}
```
Is this line throwing any error?
--
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]