Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SPARK-39234][SQL][3.3] Code clean up in SparkThrowableHelper.getMessage #36669

Closed
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/src/main/scala/org/apache/spark/ErrorInfo.scala
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ private[spark] object SparkThrowableHelper {
val errorInfo = errorClassToInfoMap.getOrElse(errorClass,
throw new IllegalArgumentException(s"Cannot find error class '$errorClass'"))
String.format(errorInfo.messageFormat.replaceAll("<[a-zA-Z0-9_-]+>", "%s"),
messageParameters: _*) + queryContext
messageParameters: _*) + s"\n$queryContext"
}

def getSqlState(errorClass: String): String = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ case class Origin(
""
}
val builder = new StringBuilder
builder ++= s"\n== SQL$objectContext$positionContext ==\n"
builder ++= s"== SQL$objectContext$positionContext ==\n"

val text = sqlText.get
val start = math.max(startIndex.get, 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -876,8 +876,7 @@ class TreeNodeSuite extends SparkFunSuite with SQLHelper {
objectType = Some("VIEW"),
objectName = Some("some_view"))
val expected =
"""
|== SQL of VIEW some_view(line 3, position 38) ==
"""== SQL of VIEW some_view(line 3, position 38) ==
|...7890 + 1234567890 + 1234567890, cast('a'
| ^^^^^^^^
|as /* comment */
Expand Down