Skip to content

Commit 58e2aa9

Browse files
marmbrusahirreddy
authored andcommitted
Build Docs for pyspark SQL Api. Minor fixes.
1 parent 4285340 commit 58e2aa9

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

python/pyspark/__init__.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,19 @@
3434
Access files shipped with jobs.
3535
- L{StorageLevel<pyspark.storagelevel.StorageLevel>}
3636
Finer-grained cache persistence levels.
37+
38+
Spark SQL:
39+
- L{SQLContext<pyspark.context.SQLContext>}
40+
Main entry point for SQL functionality.
41+
- L{SchemaRDD<pyspark.rdd.SchemaRDD>}
42+
A Resilient Distributed Dataset (RDD) with Schema information for the data contained. In
43+
addition to normal RDD operations, SchemaRDDs also support SQL.
44+
- L{Row<pyspark.rdd.Row>}
45+
A Row of data returned by a Spark SQL query.
46+
47+
Hive:
48+
- L{HiveContext<pyspark.context.HiveContext>}
49+
Main entry point for accessing data stored in Apache Hive..
3750
"""
3851

3952

@@ -45,9 +58,12 @@
4558

4659
from pyspark.conf import SparkConf
4760
from pyspark.context import SparkContext
61+
from pyspark.context import SQLContext
4862
from pyspark.rdd import RDD
63+
from pyspark.rdd import SchemaRDD
64+
from pyspark.rdd import Row
4965
from pyspark.files import SparkFiles
5066
from pyspark.storagelevel import StorageLevel
5167

5268

53-
__all__ = ["SparkConf", "SparkContext", "RDD", "SparkFiles", "StorageLevel"]
69+
__all__ = ["SparkConf", "SparkContext", "SQLContext", "RDD", "SchemaRDD", "SparkFiles", "StorageLevel", "Row"]

python/pyspark/context.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,7 @@ def registerRDDAsTable(self, rdd, tableName):
541541
"""
542542
Registers the given RDD as a temporary table in the catalog. Temporary tables exist only
543543
during the lifetime of this instance of SQLContext.
544+
544545
>>> from pyspark.context import SQLContext
545546
>>> sqlCtx = SQLContext(sc)
546547
>>> rdd = sc.parallelize([{"field1" : 1, "field2" : "row1"},
@@ -591,6 +592,7 @@ def sql(self, sqlQuery):
591592
def table(self, tableName):
592593
"""
593594
Returns the specified table as a L{SchemaRDD}.
595+
594596
>>> from pyspark.context import SQLContext
595597
>>> sqlCtx = SQLContext(sc)
596598
>>> rdd = sc.parallelize([{"field1" : 1, "field2" : "row1"},

python/pyspark/rdd.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1457,6 +1457,7 @@ def registerAsTable(self, name):
14571457
"""
14581458
Registers this RDD as a temporary table using the given name. The lifetime of this temporary
14591459
table is tied to the L{SQLContext} that was used to create this SchemaRDD.
1460+
14601461
>>> from pyspark.context import SQLContext
14611462
>>> sqlCtx = SQLContext(sc)
14621463
>>> rdd = sc.parallelize([{"field1" : 1, "field2" : "row1"},

0 commit comments

Comments
 (0)