sunchao commented on code in PR #178:
URL: 
https://github.com/apache/arrow-datafusion-comet/pull/178#discussion_r1528995242


##########
common/src/main/java/org/apache/comet/vector/CometPlainVector.java:
##########
@@ -113,7 +113,11 @@ public UTF8String getUTF8String(int rowId) {
       byte[] result = new byte[length];
       Platform.copyMemory(
           null, valueBufferAddress + offset, result, 
Platform.BYTE_ARRAY_OFFSET, length);
-      return UTF8String.fromString(convertToUuid(result).toString());
+      if (length == 16) {
+        return UTF8String.fromString(convertToUuid(result).toString());
+      } else {
+        return UTF8String.fromBytes(result);
+      }

Review Comment:
   What I mean is we remove the logic of UUID for now
   
   ```scala
     @Override
     public UTF8String getUTF8String(int rowId) {
       if (!isBaseFixedWidthVector) {
         BaseVariableWidthVector varWidthVector = (BaseVariableWidthVector) 
valueVector;
         long offsetBufferAddress = 
varWidthVector.getOffsetBuffer().memoryAddress();
         int offset = Platform.getInt(null, offsetBufferAddress + rowId * 4L);
         int length = Platform.getInt(null, offsetBufferAddress + (rowId + 1L) 
* 4L) - offset;
         return UTF8String.fromAddress(null, valueBufferAddress + offset, 
length);
       } else {
         BaseFixedWidthVector fixedWidthVector = (BaseFixedWidthVector) 
valueVector;
         int length = fixedWidthVector.getTypeWidth();
         int offset = rowId * length;
         byte[] result = new byte[length];
         Platform.copyMemory(
             null, valueBufferAddress + offset, result, 
Platform.BYTE_ARRAY_OFFSET, length);
         return UTF8String.fromBytes(result);
   ```



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

Reply via email to