Skip to content

Commit f5cac74

Browse files
committed
remove local hivecontext test
1 parent 578234d commit f5cac74

File tree

1 file changed

+0
-27
lines changed

1 file changed

+0
-27
lines changed

python/pyspark/sql.py

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1379,33 +1379,6 @@ def hql(self, hqlQuery):
13791379

13801380
class LocalHiveContext(HiveContext):
13811381

1382-
"""Starts up an instance of hive where metadata is stored locally.
1383-
1384-
An in-process metadata data is created with data stored in ./metadata.
1385-
Warehouse data is stored in in ./warehouse.
1386-
1387-
>>> import os
1388-
>>> hiveCtx = LocalHiveContext(sc)
1389-
>>> try:
1390-
... supress = hiveCtx.sql("DROP TABLE src")
1391-
... except Exception:
1392-
... pass
1393-
>>> kv1 = os.path.join(os.environ["SPARK_HOME"],
1394-
... 'examples/src/main/resources/kv1.txt')
1395-
>>> supress = hiveCtx.sql(
1396-
... "CREATE TABLE IF NOT EXISTS src (key INT, value STRING)")
1397-
>>> supress = hiveCtx.sql("LOAD DATA LOCAL INPATH '%s' INTO TABLE src"
1398-
... % kv1)
1399-
>>> results = hiveCtx.sql("FROM src SELECT value"
1400-
... ).map(lambda r: int(r.value.split('_')[1]))
1401-
>>> num = results.count()
1402-
>>> reduce_sum = results.reduce(lambda x, y: x + y)
1403-
>>> num
1404-
500
1405-
>>> reduce_sum
1406-
130091
1407-
"""
1408-
14091382
def __init__(self, sparkContext, sqlContext=None):
14101383
HiveContext.__init__(self, sparkContext, sqlContext)
14111384
warnings.warn("LocalHiveContext is deprecated. "

0 commit comments

Comments
 (0)