You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "clownxc (via GitHub)" <gi...@apache.org> on 2023/03/26 03:30:16 UTC

[GitHub] [spark] clownxc commented on a diff in pull request #40400: [SPARK-41359][SQL] Use `PhysicalDataType` instead of DataType in UnsafeRow

clownxc commented on code in PR #40400:
URL: https://github.com/apache/spark/pull/40400#discussion_r1148469116


##########
sql/catalyst/src/main/java/org/apache/spark/sql/catalyst/expressions/UnsafeRow.java:
##########
@@ -73,48 +74,44 @@ public static int calculateBitSetWidthInBytes(int numFields) {
   /**
    * Field types that can be updated in place in UnsafeRows (e.g. we support set() for these types)
    */
-  public static final Set<DataType> mutableFieldTypes;
+  public static final Set<PhysicalDataType> mutableFieldTypes;
 
   // DecimalType, DayTimeIntervalType and YearMonthIntervalType are also mutable
   static {
     mutableFieldTypes = Collections.unmodifiableSet(
       new HashSet<>(
         Arrays.asList(
-          NullType,
-          BooleanType,
-          ByteType,
-          ShortType,
-          IntegerType,
-          LongType,
-          FloatType,
-          DoubleType,
-          DateType,
-          TimestampType,
-          TimestampNTZType
+          PhysicalNullType$.MODULE$,

Review Comment:
   Thank you, I will try to modify the code as you say
   
   
   
   > this looks ugly. Instead of having a Set, shall we just add a `def isPrimitive` in `PhysicalDataType`?
   Thank you, I will try to modify the code as you say
   
   
   



-- 
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: reviews-unsubscribe@spark.apache.org

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


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