skambha commented on a change in pull request #24593: [SPARK-27692][SQL] Add
new optimizer rule to evaluate the deterministic scala udf only once if all
inputs are literals
URL: https://github.com/apache/spark/pull/24593#discussion_r288253972
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/internal/SQLConf.scala
##########
@@ -150,6 +150,16 @@ object SQLConf {
}
}
+ val DETERMINISTIC_UDF_FOLD_ENABLED =
buildConf("spark.deterministic.udf.folding.enabled")
+ .doc("When true, it will enable the optimization for a UDF that is
deterministic and the " +
+ "inputs are all literals. When your inputs to the UDF are all literal
and UDF is " +
+ "deterministic, we can optimize this to evaluate the UDF once and use
the output " +
+ "instead of evaluating the UDF each time for every row in the query." +
+ "Ensure that your UDFs are correctly setup with respect to whether they
are " +
+ "deterministic or not, before enabling this.")
+ .booleanConf
+ .createWithDefault(false)
Review comment:
If we make the default 'true' then we would need to change the existing
tests and that was the state the original PR was. Per your feedback
https://github.com/apache/spark/pull/24593#issuecomment-493705238, we changed
it to make it default 'false' to move this forward. I think we should leave it
as 'false' so it does not get confusing.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]