Skip to content

Commit 93a2b08

Browse files
nthanviSumedh Wale
authored andcommitted
[SNAPPYDATA] Use SnappyContext as default SQLContext on shell (#35)
1 parent 7851ea5 commit 93a2b08

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

python/pyspark/shell.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import pyspark
3131
from pyspark.context import SparkContext
3232
from pyspark.sql import SparkSession, SQLContext
33+
from pyspark.sql.snappy import SnappyContext
3334
from pyspark.storagelevel import StorageLevel
3435

3536
if os.environ.get("SPARK_EXECUTOR_URI"):
@@ -38,6 +39,8 @@
3839
SparkContext._ensure_initialized()
3940

4041
try:
42+
sqlContext = SnappyContext(sc)
43+
except py4j.protocol.Py4JError:
4144
# Try to access HiveConf, it will raise exception if Hive is not added
4245
SparkContext._jvm.org.apache.hadoop.hive.conf.HiveConf()
4346
spark = SparkSession.builder\

0 commit comments

Comments
 (0)