GitHub user piaozhexiu opened a pull request:
https://github.com/apache/spark/pull/7203
[SPARK-8572] [SQL] Type coercion for ScalaUDFs
Implemented type coercion for udf arguments in Scala. The changes include-
* Add `with ExpectsInputTypes ` to `ScalaUDF` class.
* Pass down argument types info from `UDFRegistration` and `functions`.
With this patch, the example query in
[SPARK-8572](https://issues.apache.org/jira/browse/SPARK-8572) no longer throws
a type cast error at runtime.
Also added a unit test to `UDFSuite` in which a decimal type is passed to a
udf that expects an int.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/piaozhexiu/spark SPARK-8572
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/7203.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #7203
----
commit 066deed940c958ba55ff7dee2d36578a3ea0b8f0
Author: Cheolsoo Park <[email protected]>
Date: 2015-07-03T00:24:00Z
Type coercion for udf inputs
----
---
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]