Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions python/pyspark/sql/column.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,8 +418,6 @@ def over(self, window):
>>> window = Window.partitionBy("name").orderBy("age").rowsBetween(-1, 1)
>>> from pyspark.sql.functions import rank, min
>>> # df.select(rank().over(window), min('age').over(window))

.. note:: Window functions is only supported with HiveContext in 1.4
"""
from pyspark.sql.window import WindowSpec
if not isinstance(window, WindowSpec):
Expand Down
9 changes: 8 additions & 1 deletion python/pyspark/sql/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

from __future__ import print_function
import sys
import warnings

if sys.version >= '3':
basestring = unicode = str
Expand Down Expand Up @@ -434,7 +435,6 @@ def streams(self):
return ContinuousQueryManager(self._ssql_ctx.streams())


# TODO(andrew): deprecate this
class HiveContext(SQLContext):
"""A variant of Spark SQL that integrates with data stored in Hive.

Expand All @@ -444,8 +444,15 @@ class HiveContext(SQLContext):
:param sparkContext: The SparkContext to wrap.
:param jhiveContext: An optional JVM Scala HiveContext. If set, we do not instantiate a new
:class:`HiveContext` in the JVM, instead we make all calls to this object.

.. note:: Deprecated in 2.0.0. Use SparkSession.builder.enableHiveSupport().getOrCreate().
"""

warnings.warn(
"HiveContext is deprecated in Spark 2.0.0. Please use " +
"SparkSession.builder.enableHiveSupport().getOrCreate() instead.",
DeprecationWarning)

def __init__(self, sparkContext, jhiveContext=None):
if jhiveContext is None:
sparkSession = SparkSession.withHiveSupport(sparkContext)
Expand Down
2 changes: 1 addition & 1 deletion python/pyspark/sql/streaming.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def _test():
globs['os'] = os
globs['sc'] = sc
globs['sqlContext'] = SQLContext(sc)
globs['hiveContext'] = HiveContext(sc)
globs['hiveContext'] = HiveContext._createForTesting(sc)
globs['df'] = \
globs['sqlContext'].read.format('text').stream('python/test_support/sql/streaming')

Expand Down