dongjoon-hyun 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_r288255431
 
 

 ##########
 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:
   Ah, sorry. I forgot my comments. :)

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

Reply via email to