You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by hvanhovell <gi...@git.apache.org> on 2018/04/19 15:27:18 UTC
[GitHub] spark pull request #20757: [SPARK-23595][SQL] ValidateExternalType should su...
Github user hvanhovell commented on a diff in the pull request:
https://github.com/apache/spark/pull/20757#discussion_r182787533
--- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/objects/objects.scala ---
@@ -1615,13 +1616,50 @@ case class ValidateExternalType(child: Expression, expected: DataType)
override def nullable: Boolean = child.nullable
- override def dataType: DataType = RowEncoder.externalDataTypeForInput(expected)
-
- override def eval(input: InternalRow): Any =
- throw new UnsupportedOperationException("Only code-generated evaluation is supported")
+ override val dataType: DataType = RowEncoder.externalDataTypeForInput(expected)
private val errMsg = s" is not a valid external type for schema of ${expected.simpleString}"
+ // This function is corresponding to `CodeGenerator.boxedType`
+ private def boxedType(dt: DataType): Class[_] = dataType match {
--- End diff --
Can you move this to `ScalaReflection`?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org