You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/03/01 06:11:41 UTC

[GitHub] [spark] maropu commented on a change in pull request #27747: [SPARK-30993][SQL] Use its sql type for UDT when checking the type of length (fixed/var) or mutable

maropu commented on a change in pull request #27747: [SPARK-30993][SQL] Use its sql type for UDT when checking the type of length (fixed/var) or mutable
URL: https://github.com/apache/spark/pull/27747#discussion_r386080439
 
 

 ##########
 File path: sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeRow.java
 ##########
 @@ -95,6 +95,10 @@ public static int calculateBitSetWidthInBytes(int numFields) {
   }
 
   public static boolean isFixedLength(DataType dt) {
+    if (dt instanceof UserDefinedType) {
+      return isFixedLength(((UserDefinedType) dt).sqlType());
+    }
+
 
 Review comment:
   nit: how about this format?
   ```
       if (dt instanceof UserDefinedType) {
         return isFixedLength(((UserDefinedType) dt).sqlType());
       } else if (dt instanceof DecimalType) {
         return ((DecimalType) dt).precision() <= Decimal.MAX_LONG_DIGITS();
       } else {
         return mutableFieldTypes.contains(dt);
       }
   ```

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org