Skip to content

Commit

Permalink
[SNAPPYDATA] Use SnappyContext as default SQLContext on shell (#35)
Browse files Browse the repository at this point in the history
Conflicts:
	python/pyspark/shell.py
  • Loading branch information
nthanvi authored and ymahajan committed Feb 21, 2018
1 parent 79130cb commit 596ac89
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions python/pyspark/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,17 @@
from pyspark import SparkConf
from pyspark.context import SparkContext
from pyspark.sql import SparkSession, SQLContext
from pyspark.sql.snappy import SnappyContext
from pyspark.storagelevel import StorageLevel

if os.environ.get("SPARK_EXECUTOR_URI"):
SparkContext.setSystemProperty("spark.executor.uri", os.environ["SPARK_EXECUTOR_URI"])

SparkContext._ensure_initialized()

try:
sqlContext = SnappyContext(sc)
except py4j.protocol.Py4JError:
# Try to access HiveConf, it will raise exception if Hive is not added
conf = SparkConf()
if conf.get('spark.sql.catalogImplementation', 'hive').lower() == 'hive':
Expand Down

0 comments on commit 596ac89

Please sign in to comment.