GitHub user wingchen opened a pull request:
https://github.com/apache/spark/pull/4146
add in tuple handling while converting form python RDD back to JavaRDD
Existing `SerDeUtil.pythonToJava` implementation does not count in tuple
cases: Pyrolite `python tuple` => `java Object[]`.
So with the following data:
```
[
(u'2', {u'director': u'David Lean', u'genres': (u'Adventure', u'Biography',
u'Drama'), u'title': u'Lawrence of Arabia', u'year': 1962}),
(u'7', {u'director': u'Andrew Dominik', u'genres': (u'Biography', u'Crime',
u'Drama'), u'title': u'The Assassination of Jesse James by the Coward Robert
Ford', u'year': 2007})
]
```
Exceptions happen with the `genres` part:
```
15/01/16 10:28:31 ERROR Executor: Exception in task 0.0 in stage 3.0 (TID 7)
java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to
java.util.ArrayList
at
org.apache.spark.api.python.SerDeUtil$$anonfun$pythonToJava$1$$anonfun$apply$1.apply(SerDeUtil.scala:157)
at
org.apache.spark.api.python.SerDeUtil$$anonfun$pythonToJava$1$$anonfun$apply$1.apply(SerDeUtil.scala:153)
at scala.collection.Iterator$$anon$13.hasNext(Iterator.scala:371)
at scala.collection.Iterator$$anon$10.hasNext(Iterator.scala:308)
```
This pull request adds in tuple handling both in `SerDeUtil.pythonToJava`
and `JavaToWritableConverter.convertToWritable`.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/wingchen/spark master
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/4146.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 #4146
----
commit 9f1a097af5362c923607991023d29bd4f455959e
Author: Winston Chen <[email protected]>
Date: 2015-01-21T22:21:12Z
add in tuple handling while converting form python RDD back to JavaRDD
----
---
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]