Github user chenghao-intel commented on a diff in the pull request:
https://github.com/apache/spark/pull/7175#discussion_r33749707
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/misc.scala
---
@@ -174,8 +171,7 @@ case class Sha1(child: Expression) extends
UnaryExpression with AutoCastInputTyp
* A function that computes a cyclic redundancy check value and returns it
as a bigint
* For input of type [[BinaryType]]
*/
-case class Crc32(child: Expression)
- extends UnaryExpression with AutoCastInputTypes {
+case class Crc32(child: Expression) extends UnaryExpression with
ExpectsInputTypes {
--- End diff --
I am not sure if we can always cast a string to binary correctly, as it
produces different binary when specifying different encoder. It's actually the
case accept multiple `DataType` for an expression.
And also for `Length`, which support both `StringType` and `BinaryType`.
We probably need another PR for this improvement.
---
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]