You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/11/29 19:10:36 UTC

[GitHub] [spark] amaliujia commented on a diff in pull request #38778: [SPARK-41227][CONNECT][PYTHON] Implement DataFrame cross join

amaliujia commented on code in PR #38778:
URL: https://github.com/apache/spark/pull/38778#discussion_r1035176076


##########
python/pyspark/sql/tests/connect/test_connect_basic.py:
##########
@@ -722,6 +722,19 @@ def test_write_operations(self):
         ndf = self.connect.read.table("parquet_test")
         self.assertEqual(set(df.collect()), set(ndf.collect()))
 
+    def test_crossjoin(self):
+        # SPARK-41227: Test CrossJoin
+        connect_df = self.connect.read.table(self.tbl_name)
+        spark_df = self.spark.read.table(self.tbl_name)
+        self.assertEqual(
+            connect_df.join(other=connect_df, how="cross").toPandas(),
+            spark_df.join(other=spark_df, how="cross").toPandas(),
+        )
+        self.assertEqual(

Review Comment:
   you can use `self.assert_eq` which is better to compare two Pandas DataFrame



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org