Skip to content

Commit

Permalink
Added schema rdd class
Browse files Browse the repository at this point in the history
  • Loading branch information
ahirreddy committed Apr 15, 2014
1 parent 67ba875 commit b8b904b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions python/pyspark/java_gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,5 +64,6 @@ def run(self):
java_import(gateway.jvm, "org.apache.spark.api.java.*")
java_import(gateway.jvm, "org.apache.spark.api.python.*")
java_import(gateway.jvm, "org.apache.spark.mllib.api.python.*")
java_import(gateway.jvm, "org.apache.spark.sql.api.java.JavaSQLContext")
java_import(gateway.jvm, "scala.Tuple2")
return gateway
8 changes: 8 additions & 0 deletions python/pyspark/rdd.py
Original file line number Diff line number Diff line change
Expand Up @@ -1387,6 +1387,14 @@ def _jrdd(self):
def _is_pipelinable(self):
return not (self.is_cached or self.is_checkpointed)

class SchemaRDD:

def __init__(self, pyRDD):
self._pyRDD = pyRDD
self.ctx = pyRDD.ctx
self.sql_ctx = self.ctx._jvm.JavaSQLContext(self.ctx._jsc)
self._jrdd = self.ctx._pythonToJava(pyRDD._jrdd)


def _test():
import doctest
Expand Down

0 comments on commit b8b904b

Please sign in to comment.