Skip to content

Commit

Permalink
[SPARK-43936][SQL] Fix bug for toSQLId
Browse files Browse the repository at this point in the history
### 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 <pbk1982@gmail.com>
Signed-off-by: yangjie01 <yangjie01@baidu.com>
  • Loading branch information
panbingkun authored and LuciferYang committed Jun 2, 2023
1 parent 6f593be commit 74b04ee
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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(".")
Expand Down

0 comments on commit 74b04ee

Please sign in to comment.