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 9fda99a2cd0 [MINOR][SQL] Wrap `given` in backticks to fix compilation 
warning
9fda99a2cd0 is described below

commit 9fda99a2cd07856eade36357228af3c2cd5cc9d4
Author: yangjie01 <yangji...@baidu.com>
AuthorDate: Wed Nov 2 08:19:30 2022 +0300

    [MINOR][SQL] Wrap `given` in backticks to fix compilation warning
    
    ### What changes were proposed in this pull request?
    A minor change to fix the a Scala related compilation warning
    
    ```
    [WARNING] 
/spark-source/sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala:105:
 [deprecation   | origin= | version=2.13.7] Wrap `given` in backticks to use it 
as an identifier, it will become a keyword in Scala 3.
    ```
    
    ### Why are the changes needed?
    Fix a Scala related compilation warning.
    
    ### Does this PR introduce _any_ user-facing change?
    No
    
    ### How was this patch tested?
    Pass GitHub Action
    
    Closes #38478 from LuciferYang/minor-wrap-given.
    
    Authored-by: yangjie01 <yangji...@baidu.com>
    Signed-off-by: Max Gekk <max.g...@gmail.com>
---
 .../scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala   | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git 
a/sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala
 
b/sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala
index f97888f046b..03d16856755 100644
--- 
a/sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala
+++ 
b/sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryCompilationErrors.scala
@@ -101,15 +101,16 @@ private[sql] object QueryCompilationErrors extends 
QueryErrorsBase {
         "pivotType" -> pivotCol.dataType.catalogString))
   }
 
+  // Wrap `given` in backticks due to it will become a keyword in Scala 3.
   def unpivotRequiresAttributes(
-      given: String,
+      `given`: String,
       empty: String,
       expressions: Seq[NamedExpression]): Throwable = {
     val nonAttributes = 
expressions.filterNot(_.isInstanceOf[Attribute]).map(toSQLExpr)
     new AnalysisException(
       errorClass = "UNPIVOT_REQUIRES_ATTRIBUTES",
       messageParameters = Map(
-        "given" -> given,
+        "given" -> `given`,
         "empty" -> empty,
         "expressions" -> nonAttributes.mkString(", ")))
   }


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

Reply via email to