ulysses-you commented on code in PR #36468: URL: https://github.com/apache/spark/pull/36468#discussion_r867323315
########## 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: We share the result between scala udf and python udf but after this pr they have different results. The scala udf follows the condition expression evluation order but python udf not. This is because we will pull out python udf and run them eagerly whatever can be reached or not. Ignore this and I create a ticket SPARK-39122 for the issue. cc @HyukjinKwon @cloud-fan -- 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]
