You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by ya...@apache.org on 2023/06/02 05:38:47 UTC

[spark] branch master updated: [SPARK-43936][SQL] Fix bug for toSQLId

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

yangjie01 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 74b04eeffdc [SPARK-43936][SQL] Fix bug for toSQLId
74b04eeffdc is described below

commit 74b04eeffdc4765f56fe3a9e97165b15ed4e2c73
Author: panbingkun <pb...@gmail.com>
AuthorDate: Fri Jun 2 13:38:29 2023 +0800

    [SPARK-43936][SQL] Fix bug for toSQLId
    
    ### What changes were proposed in this pull request?
    The pr aims to fix issue for QueryErrorBase.toSQLId.
    eg:
    1.https://github.com/beliefer/spark/actions/runs/5144414857/jobs/9261862936
    2.https://github.com/panbingkun/spark/actions/runs/5145364900/jobs/9262927798
    3.https://github.com/panbingkun/spark/actions/runs/5143676069/jobs/9259636037
    
    ### Why are the changes needed?
    After SPARK-43910, `__auto_generated_subquery_name` from ids in errors should remove, but when the type of `parts` is ArrayBuffer, match will fail. causing unexpected behavior.
    
    ### Does this PR introduce _any_ user-facing change?
    No.
    
    ### How was this patch tested?
    - Manually test.
    - Pass GA.
    
    Closes #41430 from panbingkun/fix_bug_natural_join.
    
    Authored-by: panbingkun <pb...@gmail.com>
    Signed-off-by: yangjie01 <ya...@baidu.com>
---
 .../src/main/scala/org/apache/spark/sql/errors/QueryErrorsBase.scala    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryErrorsBase.scala b/sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryErrorsBase.scala
index 885b2f775e0..77f714a0f90 100644
--- a/sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryErrorsBase.scala
+++ b/sql/catalyst/src/main/scala/org/apache/spark/sql/errors/QueryErrorsBase.scala
@@ -72,7 +72,7 @@ private[sql] trait QueryErrorsBase {
 
   def toSQLId(parts: Seq[String]): String = {
     val cleaned = parts match {
-      case "__auto_generated_subquery_name" :: rest if rest != Nil => rest
+      case Seq("__auto_generated_subquery_name", rest @ _*) if rest != Nil => rest
       case other => other
     }
     cleaned.map(quoteIdentifier).mkString(".")


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