GitHub user smungee opened a pull request:
https://github.com/apache/spark/pull/13108
Fix MapObjects.itemAccessorMethod to handle TimestampType
## What changes were proposed in this pull request?
Fix `MapObjects.itemAccessorMethod` to handle `TimestampType`. Without this
fix, this method threw the following error for UDFs that returned
`TimestampType`. (Also recommend that this be picked up for the 2.0 release)
` Caused by: scala.MatchError: TimestampType (of class
org.apache.spark.sql.types.TimestampType$)
at
org.apache.spark.sql.catalyst.expressions.MapObjects.itemAccessorMethod(objects.scala:379)
at
org.apache.spark.sql.catalyst.expressions.MapObjects.x$20$lzycompute(objects.scala:414)
at
org.apache.spark.sql.catalyst.expressions.MapObjects.x$20(objects.scala:399)
at
org.apache.spark.sql.catalyst.expressions.MapObjects.primitiveElement$lzycompute(objects.scala:399)
at
org.apache.spark.sql.catalyst.expressions.MapObjects.primitiveElement(objects.scala:399)
at
org.apache.spark.sql.catalyst.expressions.MapObjects.doGenCode(objects.scala:450)
at
org.apache.spark.sql.catalyst.expressions.Expression$$anonfun$genCode$2.apply(Expression.scala:105)
at
org.apache.spark.sql.catalyst.expressions.Expression$$anonfun$genCode$2.apply(Expression.scala:102)
at scala.Option.getOrElse(Option.scala:121)`
## How was this patch tested?
Existing tests
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/smungee/spark fix-itemAccessorMethod
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/13108.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 #13108
----
commit a4b8daf124fc0caf821dc7b2b377167ed3aeb211
Author: Sumedh Mungee <[email protected]>
Date: 2016-05-13T22:39:41Z
Fix MapObjects.itemAccessorMethod to handle TimestampType
Without this fix, this method throws a MatchError for TimestampType
----
---
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]