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


##########
pinot-core/src/main/java/org/apache/pinot/core/segment/processing/genericrow/GenericRowDeserializer.java:
##########
@@ -164,6 +164,18 @@ public void deserialize(long offset, GenericRow buffer) {
               multiValue[j] = new String(stringBytes, UTF_8);
             }
             break;
+          case BYTES:
+            // Used by MV UUID (storedType=BYTES). Mirrors the writer in 
GenericRowSerializer:
+            // each element is length-prefixed.

Review Comment:
   (nit) No need to add this comments. It is just a gap before



##########
pinot-core/src/main/java/org/apache/pinot/core/segment/processing/genericrow/GenericRowDeserializer.java:
##########
@@ -366,6 +378,26 @@ public int compare(long offset1, long offset2, int 
numFieldsToCompare) {
               offset2 += numBytes2;
             }
             break;
+          case BYTES:
+            // Used by MV UUID (storedType=BYTES). Element-wise unsigned byte 
compare matches the SV BYTES
+            // ordering above.

Review Comment:
   Same here, and in other classes



##########
pinot-core/src/main/java/org/apache/pinot/core/segment/processing/genericrow/GenericRowDeserializer.java:
##########
@@ -164,6 +164,18 @@ public void deserialize(long offset, GenericRow buffer) {
               multiValue[j] = new String(stringBytes, UTF_8);
             }
             break;
+          case BYTES:

Review Comment:
   Not introduced in this PR, but `BIG_DECIMAL` support is also missing



##########
pinot-core/src/main/java/org/apache/pinot/core/util/SegmentProcessorAvroUtils.java:
##########
@@ -57,20 +61,50 @@ public static GenericData.Record 
convertGenericRowToAvroRecord(GenericRow generi
    */
   public static GenericData.Record convertGenericRowToAvroRecord(GenericRow 
genericRow,
       GenericData.Record reusableRecord, Set<String> fields) {
+    Schema avroSchema = reusableRecord.getSchema();
     for (String field : fields) {
       Object value = genericRow.getValue(field);
       if (value instanceof Object[]) {
-        reusableRecord.put(field, Arrays.asList((Object[]) value));
+        Schema.Field avroField = avroSchema.getField(field);
+        if (avroField != null && isUuidArrayLogicalType(avroField.schema())) {
+          // MV UUID columns are emitted with an Avro 
array<string{logicalType:uuid}> schema; convert each
+          // 16-byte element to its canonical UUID string so 
GenericDatumWriter accepts the record.

Review Comment:
   What format does `GenericDatumWriter` take? Only UUID string?



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to