Skip to content

Commit c608947

Browse files
committed
SchemaRDD now has all RDD operations
1 parent 725c91e commit c608947

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

python/pyspark/rdd.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1401,14 +1401,26 @@ def __init__(self, jschema_rdd, sql_ctx):
14011401
self._sc = sql_ctx._sc
14021402
self._jschema_rdd = jschema_rdd
14031403

1404+
self._jrdd = self.toPython()._jrdd
1405+
self.is_cached = False
1406+
self.is_checkpointed = False
1407+
self.ctx = self.sql_ctx._sc
1408+
self._jrdd_deserializer = self.ctx.serializer
1409+
# TODO: Figure out how to make this lazy
1410+
#self._id = self._jrdd.id()
1411+
14041412
def registerAsTable(self, name):
14051413
self._jschema_rdd.registerAsTable(name)
14061414

14071415
def toPython(self):
14081416
jrdd = self._jschema_rdd.javaToPython()
1409-
#jrdd = self._sc._javaToPython(self._jschema_rdd)
14101417
return RDD(jrdd, self._sc, self._sc.serializer).map(lambda d: Row(d))
14111418

1419+
customRDDDict = dict(RDD.__dict__)
1420+
del customRDDDict["__init__"]
1421+
1422+
SchemaRDD.__dict__.update(customRDDDict)
1423+
14121424
def _test():
14131425
import doctest
14141426
from pyspark.context import SparkContext

0 commit comments

Comments
 (0)