Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update to use AutoCastInputTypes
  • Loading branch information
zhichao-li committed Jun 30, 2015
commit cde73f57600bc83f89c9614bfdc690bf5e970895
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ case class Pow(left: Expression, right: Expression)
* Resulting characters are returned as a byte array.
*/
case class UnHex(child: Expression)
extends UnaryExpression with ExpectsInputTypes with Serializable {
extends UnaryExpression with AutoCastInputTypes with Serializable {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think unhex only works on StringType, so we should not use AutoCastInputTypes here, we should use checkInputDataTypes instead.


override def expectedChildTypes: Seq[DataType] = Seq(StringType)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@davies this could be changed to ByteType, couldn't it? This avoids a cast, if someone calls this with a byte array.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hex() return StringType, so unhex() should take StringType, not BinaryType.


Expand Down