Github user viirya commented on a diff in the pull request:
https://github.com/apache/spark/pull/13401#discussion_r65294127
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/objects/objects.scala
---
@@ -721,8 +716,55 @@ case class GetExternalRowField(
"cannot be null.");
}
- final ${ctx.javaType(dataType)} ${ev.value} = $getField;
+ final Object ${ev.value} = ${row.value}.get($index);
"""
ev.copy(code = code, isNull = "false")
}
}
+
+/**
+ * Validates the actual data type of input expression at runtime. If it
doesn't match the
+ * expectation, throw an exception.
+ */
+case class ValidateExternalType(child: Expression, expected: DataType)
--- End diff --
hmm, for the trust, it should be said that we leave the responsibility of
data correctness to users. Actually when the data is in wrong type, we will not
get wrong result. There is of course an exception regarding data converting
will be thrown. However, better error handling is always good if as you said
the performance is not big issue here.
---
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]