Skip to content
Prev Previous commit
Next Next commit
Use _active_spark_context in place of getOrCreate
  • Loading branch information
zero323 committed Feb 1, 2017
commit cb496f3e5384f822b7e254a808af3ddae2dd6ff6
6 changes: 3 additions & 3 deletions python/pyspark/sql/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1854,9 +1854,9 @@ def _create_judf(self):
return judf

def __call__(self, *cols):
sc = SparkContext.getOrCreate()
jc = self._judf.apply(_to_seq(sc, cols, _to_java_column))
return Column(jc)
judf = self._judf
sc = SparkContext._active_spark_context
return Column(judf.apply(_to_seq(sc, cols, _to_java_column)))


@since(1.3)
Expand Down