Github user rxin commented on a diff in the pull request:
https://github.com/apache/spark/pull/7202#discussion_r33839940
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/types/AbstractDataType.scala
---
@@ -28,7 +28,45 @@ import org.apache.spark.util.Utils
* A non-concrete data type, reserved for internal uses.
*/
private[sql] abstract class AbstractDataType {
+ /**
+ * The default concrete type to use if we want to cast a null literal
into this type.
+ */
private[sql] def defaultConcreteType: DataType
+
+ /**
+ * Returns true if this data type is a parent of the `childCandidate`.
+ */
+ private[sql] def isParentOf(childCandidate: DataType): Boolean
+}
+
+
+/**
+ * A collection of types that can be used to specify type constraints. The
sequence also specifies
+ * precedence: an earlier type takes precedence over a latter type.
+ *
+ * {{{
+ * TypeCollection(StringType, BinaryType)
+ * }}}
+ *
+ * This means that we prefer StringType over BinaryType if it is possible
to cast to StringType.
+ */
+private[sql] class TypeCollection(private val types: Seq[DataType])
extends AbstractDataType {
+ require(types.nonEmpty, s"TypeCollection ($types) cannot be empty")
+
+ private[sql] override def defaultConcreteType: DataType = types.head
--- End diff --
yes, this is only used for null type. so your concern isn't really a
problem.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]