MaxGekk commented on code in PR #51383:
URL: https://github.com/apache/spark/pull/51383#discussion_r2190634291


##########
sql/api/src/main/scala/org/apache/spark/sql/types/AbstractDataType.scala:
##########
@@ -181,7 +181,7 @@ private[spark] object AnsiIntervalType extends 
AbstractDataType {
  */
 private[sql] abstract class AnyTimeType extends DatetimeType
 
-private[spark] object AnyTimeType extends AbstractDataType {
+private[spark] object AnyTimeType extends AbstractDataType with Serializable {

Review Comment:
   Yes, otherwise `StaticInvoke` fails with:
   ```
   java.io.NotSerializableException: org.apache.spark.sql.types.AnyTimeType$
   Serialization stack:
        - object not serializable (class: 
org.apache.spark.sql.types.AnyTimeType$, value: 
org.apache.spark.sql.types.AnyTimeType$@1929425f)
        - writeObject data (class: 
scala.collection.generic.DefaultSerializationProxy)
        - object (class scala.collection.generic.DefaultSerializationProxy, 
scala.collection.generic.DefaultSerializationProxy@29d37757)
        - writeReplace data (class: 
scala.collection.generic.DefaultSerializationProxy)
        - object (class scala.collection.immutable.$colon$colon, 
List(org.apache.spark.sql.types.AnyTimeType$@1929425f, IntegerType, 
DayTimeIntervalType, ByteType, IntegerType))
        - field (class: 
org.apache.spark.sql.catalyst.expressions.objects.StaticInvoke, name: 
inputTypes, type: interface scala.collection.immutable.Seq)
        - object (class 
org.apache.spark.sql.catalyst.expressions.objects.StaticInvoke, 
static_invoke(DateTimeUtils.timeAddInterval(null, 6, INTERVAL '0 01:00:00' DAY 
TO SECOND, 3, 6)))
        at 
org.apache.spark.serializer.SerializationDebugger$.improveException(SerializationDebugger.scala:43)
        at 
org.apache.spark.serializer.JavaSerializationStream.writeObject(JavaSerializer.scala:50)
        at 
org.apache.spark.serializer.JavaSerializerInstance.serialize(JavaSerializer.scala:122)
   ```



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