You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2022/09/09 07:48:59 UTC

[GitHub] [spark] cloud-fan commented on a diff in pull request #37841: [SPARK-40324][SQL] Provide query context in AnalysisException

cloud-fan commented on code in PR #37841:
URL: https://github.com/apache/spark/pull/37841#discussion_r966737035


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/AnalysisException.scala:
##########
@@ -124,12 +126,16 @@ class AnalysisException protected[sql] (
       plan: Option[LogicalPlan] = this.plan,
       cause: Option[Throwable] = this.cause,
       errorClass: Option[String] = this.errorClass,
-      messageParameters: Array[String] = this.messageParameters): AnalysisException =
+      messageParameters: Array[String] = this.messageParameters,
+      context: Array[QueryContext] = Array.empty): AnalysisException =
     new AnalysisException(message, line, startPosition, plan, cause, errorClass, errorSubClass,
-      messageParameters)
+      messageParameters, context)
 
-  def withPosition(line: Option[Int], startPosition: Option[Int]): AnalysisException = {
-    val newException = this.copy(line = line, startPosition = startPosition)
+  def withPosition(origin: Origin): AnalysisException = {
+    val newException = this.copy(
+      line = origin.line,
+      startPosition = origin.startPosition,

Review Comment:
   do we still need the `line` and `startPosition` parameters? 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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