You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by GitBox <gi...@apache.org> on 2022/07/20 19:13:54 UTC

[GitHub] [pinot] Jackie-Jiang commented on a diff in pull request #9077: Ensure conversion of field specs to avro schema is ordered

Jackie-Jiang commented on code in PR #9077:
URL: https://github.com/apache/pinot/pull/9077#discussion_r925970719


##########
pinot-core/src/main/java/org/apache/pinot/core/util/SegmentProcessorAvroUtils.java:
##########
@@ -74,7 +74,10 @@ public static GenericData.Record convertGenericRowToAvroRecord(GenericRow generi
   public static Schema convertPinotSchemaToAvroSchema(org.apache.pinot.spi.data.Schema pinotSchema) {
     SchemaBuilder.FieldAssembler<org.apache.avro.Schema> fieldAssembler = SchemaBuilder.record("record").fields();
 
-    for (FieldSpec fieldSpec : pinotSchema.getAllFieldSpecs()) {
+    List<FieldSpec> orderedFieldSpecs = pinotSchema.getAllFieldSpecs().stream()
+        .sorted()

Review Comment:
   Good catch! Here we want to order the fields by name. `FieldSpec` itself is not comparable



-- 
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: commits-unsubscribe@pinot.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org