cloud-fan commented on code in PR #40651:
URL: https://github.com/apache/spark/pull/40651#discussion_r1157911591
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/types/PhysicalDataType.scala:
##########
@@ -17,53 +17,204 @@
package org.apache.spark.sql.catalyst.types
-import org.apache.spark.sql.types._
+import scala.reflect.runtime.universe.TypeTag
+import scala.reflect.runtime.universe.typeTag
+import scala.util.control.NonFatal
+import org.apache.spark.sql.catalyst.util.SQLOrderingUtil
+import org.apache.spark.sql.errors.QueryExecutionErrors
+import org.apache.spark.sql.types.{BinaryType, BooleanType, ByteType,
DataType, DateType, DayTimeIntervalType, Decimal, DecimalType, DoubleType,
FloatType, IntegerType, IntegralType, LongType, NullType, NumericType,
ShortType, StringType, StructField, TimestampNTZType, TimestampType,
YearMonthIntervalType}
+import org.apache.spark.unsafe.types.{ByteArray, UTF8String}
sealed abstract class PhysicalDataType
-sealed abstract class PhysicalPrimitiveType extends PhysicalDataType
+object PhysicalDataType {
+ def apply(dt: DataType): PhysicalDataType = dt match {
+ case NullType => PhysicalNullType
+ case ByteType => PhysicalByteType
+ case ShortType => PhysicalShortType
+ case IntegerType => PhysicalIntegerType
+ case LongType => PhysicalLongType
+ case StringType => PhysicalStringType
+ case FloatType => PhysicalFloatType
+ case DoubleType => PhysicalDoubleType
+ case DecimalType.Fixed(p, s) => PhysicalDecimalType(p, s)
+ case BooleanType => PhysicalBooleanType
+ case BinaryType => PhysicalBinaryType
+ case TimestampType => PhysicalLongType
+ case TimestampNTZType => PhysicalLongType
+ case DayTimeIntervalType(_, _) => PhysicalLongType
+ case YearMonthIntervalType(_, _) => PhysicalIntegerType
+ case DateType => PhysicalIntegerType
+ case _ => UninitializedPhysicalType
Review Comment:
let's also include array/map/struct
--
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]