File tree Expand file tree Collapse file tree 3 files changed +9
-4
lines changed Expand file tree Collapse file tree 3 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -418,8 +418,6 @@ def over(self, window):
418418 >>> window = Window.partitionBy("name").orderBy("age").rowsBetween(-1, 1)
419419 >>> from pyspark.sql.functions import rank, min
420420 >>> # df.select(rank().over(window), min('age').over(window))
421-
422- .. note:: Window functions is only supported with HiveContext in 1.4
423421 """
424422 from pyspark .sql .window import WindowSpec
425423 if not isinstance (window , WindowSpec ):
Original file line number Diff line number Diff line change 1717
1818from __future__ import print_function
1919import sys
20+ import warnings
2021
2122if sys .version >= '3' :
2223 basestring = unicode = str
@@ -434,7 +435,6 @@ def streams(self):
434435 return ContinuousQueryManager (self ._ssql_ctx .streams ())
435436
436437
437- # TODO(andrew): deprecate this
438438class HiveContext (SQLContext ):
439439 """A variant of Spark SQL that integrates with data stored in Hive.
440440
@@ -444,8 +444,15 @@ class HiveContext(SQLContext):
444444 :param sparkContext: The SparkContext to wrap.
445445 :param jhiveContext: An optional JVM Scala HiveContext. If set, we do not instantiate a new
446446 :class:`HiveContext` in the JVM, instead we make all calls to this object.
447+
448+ .. note:: Deprecated in 2.0.0. Use SparkSession.builder.enableHiveSupport().getOrCreate().
447449 """
448450
451+ warnings .warn (
452+ "HiveContext is deprecated in Spark 2.0.0. Please use " +
453+ "SparkSession.builder.enableHiveSupport().getOrCreate() instead." ,
454+ DeprecationWarning )
455+
449456 def __init__ (self , sparkContext , jhiveContext = None ):
450457 if jhiveContext is None :
451458 sparkSession = SparkSession .withHiveSupport (sparkContext )
Original file line number Diff line number Diff line change @@ -221,7 +221,7 @@ def _test():
221221 globs ['os' ] = os
222222 globs ['sc' ] = sc
223223 globs ['sqlContext' ] = SQLContext (sc )
224- globs ['hiveContext' ] = HiveContext (sc )
224+ globs ['hiveContext' ] = HiveContext . _createForTesting (sc )
225225 globs ['df' ] = \
226226 globs ['sqlContext' ].read .format ('text' ).stream ('python/test_support/sql/streaming' )
227227
You can’t perform that action at this time.
0 commit comments