holdenk commented on code in PR #59814:
URL: https://github.com/apache/spark/pull/59814#discussion_r4429549556


##########
python/pyspark/sql/tests/test_udf_transpile_unit.py:
##########
@@ -1841,6 +1841,33 @@ def test_udf_transpile_udf_as_a_predicate(self):
             self.assertGreater(self._eval_python_count(joined), 0, 
self._optimized_plan(joined))
             self.assertEqual([(4.0, 2.0, 2.0)], [tuple(r) for r in 
joined.collect()])
 
+    def test_udf_transpile_keeps_the_cross_join_guard(self):
+        # SPARK-58780: with cross joins disabled, a UDF that is the only thing 
tying a join's sides
+        # together must still fail the query as a cartesian product, as it 
does with transpilation
+        # off. Lowered, it read both sides and passed the check, then ran as a 
CartesianProduct.

Review Comment:
   I follow this logic, however, could we rework it so that we've got a viable 
join condition in the comparision case instead of falling back to a 
CartesianProduct? We could do this as a follow on step if only sometimes that's 
the case (e.g. when a and b are for sure not null)? WDYT @jzhan-2026 ?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to