cloud-fan commented on code in PR #36468:
URL: https://github.com/apache/spark/pull/36468#discussion_r868225414


##########
sql/core/src/test/resources/sql-tests/inputs/udf/postgreSQL/udf-case.sql:
##########
@@ -67,14 +67,12 @@ SELECT '7' AS `None`,
   CASE WHEN rand() < udf(0) THEN 1
   END AS `NULL on no matches`;
 
--- [SPARK-33008] Spark SQL throws an exception
 -- Constant-expression folding shouldn't evaluate unreachable subexpressions
 SELECT CASE WHEN udf(1=0) THEN 1/0 WHEN 1=1 THEN 1 ELSE 2/0 END;
 SELECT CASE 1 WHEN 0 THEN 1/udf(0) WHEN 1 THEN 1 ELSE 2/0 END;
 
--- However we do not currently suppress folding of potentially
--- reachable subexpressions
-SELECT CASE WHEN i > 100 THEN udf(1/0) ELSE udf(0) END FROM case_tbl;
+-- SPARK-39122: Python UDF does not follow the conditional expression 
evaluation order
+-- SELECT CASE WHEN i > 100 THEN udf(1/0) ELSE udf(0) END FROM case_tbl;

Review Comment:
   Unfortunately I think it's very hard to fix. We can probably have a "result 
holder" for python udf, and the "result holder" will only fail if it's actually 
accessed. +1 to ignore for now.



-- 
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