mbutrovich commented on code in PR #4364:
URL: https://github.com/apache/datafusion-comet/pull/4364#discussion_r3282470251


##########
spark/src/main/java/org/apache/comet/vector/CometPlainVector.java:
##########
@@ -143,6 +148,8 @@ public UTF8String getUTF8String(int rowId) {
       } else {
         return UTF8String.fromString(convertToUuid(result).toString());
       }
+    } else {
+      throw new RuntimeException("Unsupported UTF8 vector type: " + 
valueVector.getName());

Review Comment:
   Is this branch reachable in practice? `NullVector` is already filtered by 
`isNullAt` because `valueBufferAddress == -1`, so I am trying to think which 
`ValueVector` subclass would actually land here. If it is truly unreachable, 
`IllegalStateException` reads as more idiomatic than `RuntimeException`.



##########
spark/src/main/java/org/apache/comet/vector/CometPlainVector.java:
##########
@@ -33,6 +33,7 @@
 /** A column vector whose elements are plainly decoded. */
 public class CometPlainVector extends CometDecodedVector {
   private final long valueBufferAddress;
+  private final long offsetBufferAddress;
   private final boolean isBaseFixedWidthVector;

Review Comment:
   Consider a `private final boolean isVariableWidthVector` alongside 
`isBaseFixedWidthVector` instead of using `offsetBufferAddress != -1` as the 
dispatch sentinel. The `-1` pattern matches the existing `valueBufferAddress` 
precedent, so this is purely taste.
   
   Alternatively, instead of an ever growing list of booleans, can we do an 
enum (maybe that's a bigger refactor and out of scope)?



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