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/07/22 05:32:58 UTC

[GitHub] [spark] MaxGekk commented on a diff in pull request #37209: [SPARK-39319][CORE][SQL] Make query contexts as a part of `SparkThrowable`

MaxGekk commented on code in PR #37209:
URL: https://github.com/apache/spark/pull/37209#discussion_r927303154


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/decimalExpressions.scala:
##########
@@ -125,11 +126,7 @@ case class CheckOverflow(
       queryContext)
 
   override protected def doGenCode(ctx: CodegenContext, ev: ExprCode): ExprCode = {
-    val errorContextCode = if (nullOnOverflow) {
-      "\"\""
-    } else {
-      ctx.addReferenceObj("errCtx", queryContext)
-    }
+    val errorContextCode = ctx.addReferenceObj("errCtx", queryContext)

Review Comment:
   > It avoids adding a reference object.
   
   Does it have real benefits? I just see overcomplicated code.



-- 
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