From 3619fec1ec395a66ad5ae1f614ce67fe173cf159 Mon Sep 17 00:00:00 2001 From: Reynold Xin Date: Thu, 24 Mar 2016 22:34:55 -0700 Subject: [SPARK-14142][SQL] Replace internal use of unionAll with union ## What changes were proposed in this pull request? unionAll has been deprecated in SPARK-14088. ## How was this patch tested? Should be covered by all existing tests. Author: Reynold Xin Closes #11946 from rxin/SPARK-14142. --- python/pyspark/sql/dataframe.py | 4 ++-- python/pyspark/sql/tests.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'python/pyspark/sql') diff --git a/python/pyspark/sql/dataframe.py b/python/pyspark/sql/dataframe.py index 5cfc348a69..7a69c4c70c 100644 --- a/python/pyspark/sql/dataframe.py +++ b/python/pyspark/sql/dataframe.py @@ -360,7 +360,7 @@ class DataFrame(object): >>> df.repartition(10).rdd.getNumPartitions() 10 - >>> data = df.unionAll(df).repartition("age") + >>> data = df.union(df).repartition("age") >>> data.show() +---+-----+ |age| name| @@ -919,7 +919,7 @@ class DataFrame(object): This is equivalent to `UNION ALL` in SQL. To do a SQL-style set union (that does deduplication of elements), use this function followed by a distinct. """ - return DataFrame(self._jdf.unionAll(other._jdf), self.sql_ctx) + return DataFrame(self._jdf.union(other._jdf), self.sql_ctx) @since(1.3) def unionAll(self, other): diff --git a/python/pyspark/sql/tests.py b/python/pyspark/sql/tests.py index 9722e9e9ca..83ef76c13c 100644 --- a/python/pyspark/sql/tests.py +++ b/python/pyspark/sql/tests.py @@ -599,7 +599,7 @@ class SQLTests(ReusedPySparkTestCase): point = df1.head().point self.assertEqual(point, PythonOnlyPoint(1.0, 2.0)) - def test_unionAll_with_udt(self): + def test_union_with_udt(self): from pyspark.sql.tests import ExamplePoint, ExamplePointUDT row1 = (1.0, ExamplePoint(1.0, 2.0)) row2 = (2.0, ExamplePoint(3.0, 4.0)) @@ -608,7 +608,7 @@ class SQLTests(ReusedPySparkTestCase): df1 = self.sqlCtx.createDataFrame([row1], schema) df2 = self.sqlCtx.createDataFrame([row2], schema) - result = df1.unionAll(df2).orderBy("label").collect() + result = df1.union(df2).orderBy("label").collect() self.assertEqual( result, [ -- cgit v1.2.3