This is an automated email from the ASF dual-hosted git repository.

maxgekk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/master by this push:
     new e848b9665134 [SPARK-47388][SQL] Pass `messageParameters` by name to 
`require()`
e848b9665134 is described below

commit e848b9665134faa866617f9caee066e23e5b30a6
Author: Max Gekk <max.g...@gmail.com>
AuthorDate: Thu Mar 14 18:25:17 2024 +0500

    [SPARK-47388][SQL] Pass `messageParameters` by name to `require()`
    
    ### What changes were proposed in this pull request?
    In the PR, I propose to pass `messageParameters` by name to avoid eager 
instantiation.
    
    ### Why are the changes needed?
    Passing `messageParameters` by value independently from `requirement` might 
introduce perf regression.
    
    ### Does this PR introduce _any_ user-facing change?
    No, this is not a part of public API.
    
    ### How was this patch tested?
    By running the affected test suite:
    ```
    $ build/sbt "test:testOnly *QueryCompilationErrorsSuite"
    ```
    
    ### Was this patch authored or co-authored using generative AI tooling?
    No.
    
    Closes #45511 from MaxGekk/fix-SparkException-require.
    
    Authored-by: Max Gekk <max.g...@gmail.com>
    Signed-off-by: Max Gekk <max.g...@gmail.com>
---
 common/utils/src/main/scala/org/apache/spark/SparkException.scala | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/utils/src/main/scala/org/apache/spark/SparkException.scala 
b/common/utils/src/main/scala/org/apache/spark/SparkException.scala
index 1dc5ee949023..6bacdd0a4440 100644
--- a/common/utils/src/main/scala/org/apache/spark/SparkException.scala
+++ b/common/utils/src/main/scala/org/apache/spark/SparkException.scala
@@ -116,7 +116,7 @@ object SparkException {
   def require(
       requirement: Boolean,
       errorClass: String,
-      messageParameters: Map[String, String]): Unit = {
+      messageParameters: => Map[String, String]): Unit = {
     if (!requirement) {
       throw new SparkIllegalArgumentException(errorClass, messageParameters)
     }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@spark.apache.org
For additional commands, e-mail: commits-h...@spark.apache.org

Reply via email to