Skip to content

Commit 81049eb

Browse files
committed
HOTFIX: PySpark tests should be order insensitive.
This has been messing up the SQL PySpark tests on Jenkins. Author: Patrick Wendell <[email protected]> Closes #1054 from pwendell/pyspark and squashes the following commits: 1eb5487 [Patrick Wendell] False change 06f062d [Patrick Wendell] HOTFIX: PySpark tests should be order insensitive
1 parent 597c7ef commit 81049eb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

python/pyspark/sql.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def parquetFile(self, path):
117117
>>> srdd = sqlCtx.inferSchema(rdd)
118118
>>> srdd.saveAsParquetFile(parquetFile)
119119
>>> srdd2 = sqlCtx.parquetFile(parquetFile)
120-
>>> srdd.collect() == srdd2.collect()
120+
>>> sorted(srdd.collect()) == sorted(srdd2.collect())
121121
True
122122
"""
123123
jschema_rdd = self._ssql_ctx.parquetFile(path)
@@ -141,7 +141,7 @@ def table(self, tableName):
141141
>>> srdd = sqlCtx.inferSchema(rdd)
142142
>>> sqlCtx.registerRDDAsTable(srdd, "table1")
143143
>>> srdd2 = sqlCtx.table("table1")
144-
>>> srdd.collect() == srdd2.collect()
144+
>>> sorted(srdd.collect()) == sorted(srdd2.collect())
145145
True
146146
"""
147147
return SchemaRDD(self._ssql_ctx.table(tableName), self)
@@ -293,7 +293,7 @@ def saveAsParquetFile(self, path):
293293
>>> srdd = sqlCtx.inferSchema(rdd)
294294
>>> srdd.saveAsParquetFile(parquetFile)
295295
>>> srdd2 = sqlCtx.parquetFile(parquetFile)
296-
>>> srdd2.collect() == srdd.collect()
296+
>>> sorted(srdd2.collect()) == sorted(srdd.collect())
297297
True
298298
"""
299299
self._jschema_rdd.saveAsParquetFile(path)
@@ -307,7 +307,7 @@ def registerAsTable(self, name):
307307
>>> srdd = sqlCtx.inferSchema(rdd)
308308
>>> srdd.registerAsTable("test")
309309
>>> srdd2 = sqlCtx.sql("select * from test")
310-
>>> srdd.collect() == srdd2.collect()
310+
>>> sorted(srdd.collect()) == sorted(srdd2.collect())
311311
True
312312
"""
313313
self._jschema_rdd.registerAsTable(name)

0 commit comments

Comments
 (0)