rymurr commented on a change in pull request #7290:
URL: https://github.com/apache/arrow/pull/7290#discussion_r441050322



##########
File path: java/vector/src/main/codegen/templates/UnionVector.java
##########
@@ -586,7 +686,9 @@ public ValueVector getVectorByType(int typeId) {
   }
 
     public ValueVector getVectorByType(int typeId, ArrowType arrowType) {
-      switch (MinorType.values()[typeId]) {
+      Types.MinorType type = (typeIds[typeId] != null) ?
+          Types.getMinorTypeForArrowType(typeIds[typeId].getType()) : 
Types.MinorType.values()[typeId];
+      switch (type) {

Review comment:
       This switch uses the `typeIds` array to extract the MinorType associated 
with the logical type. If it does not exist in the array (usually because a 
logical type wasn't previously assigned) it defaults to the id of the minor 
type. So Java always uses the MinorType as the type id and allows c++ (and 
others) to send arbitrary type mappings.




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

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


Reply via email to