File tree Expand file tree Collapse file tree 1 file changed +0
-27
lines changed Expand file tree Collapse file tree 1 file changed +0
-27
lines changed Original file line number Diff line number Diff line change @@ -1379,33 +1379,6 @@ def hql(self, hqlQuery):
13791379
13801380class 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. "
You can’t perform that action at this time.
0 commit comments