grundprinzip commented on code in PR #46789:
URL: https://github.com/apache/spark/pull/46789#discussion_r1643858481
##########
connector/connect/server/src/main/scala/org/apache/spark/sql/connect/utils/ErrorUtils.scala:
##########
@@ -118,15 +118,27 @@ private[connect] object ErrorUtils extends Logging {
sparkThrowableBuilder.setErrorClass(sparkThrowable.getErrorClass)
}
for (queryCtx <- sparkThrowable.getQueryContext) {
- sparkThrowableBuilder.addQueryContexts(
- FetchErrorDetailsResponse.QueryContext
- .newBuilder()
+ val builder = FetchErrorDetailsResponse.QueryContext
+ .newBuilder()
+ val context = if (queryCtx.contextType() == QueryContextType.SQL) {
+ builder
+
.setContextType(FetchErrorDetailsResponse.QueryContext.ContextType.SQL)
.setObjectType(queryCtx.objectType())
.setObjectName(queryCtx.objectName())
.setStartIndex(queryCtx.startIndex())
.setStopIndex(queryCtx.stopIndex())
.setFragment(queryCtx.fragment())
- .build())
+ .setSummary(queryCtx.summary())
+ .build()
+ } else {
Review Comment:
Is this reall an unconditional else?
##########
connector/connect/server/src/main/scala/org/apache/spark/sql/connect/utils/ErrorUtils.scala:
##########
@@ -118,15 +118,27 @@ private[connect] object ErrorUtils extends Logging {
sparkThrowableBuilder.setErrorClass(sparkThrowable.getErrorClass)
}
for (queryCtx <- sparkThrowable.getQueryContext) {
- sparkThrowableBuilder.addQueryContexts(
- FetchErrorDetailsResponse.QueryContext
- .newBuilder()
+ val builder = FetchErrorDetailsResponse.QueryContext
+ .newBuilder()
+ val context = if (queryCtx.contextType() == QueryContextType.SQL) {
+ builder
+
.setContextType(FetchErrorDetailsResponse.QueryContext.ContextType.SQL)
.setObjectType(queryCtx.objectType())
.setObjectName(queryCtx.objectName())
.setStartIndex(queryCtx.startIndex())
.setStopIndex(queryCtx.stopIndex())
.setFragment(queryCtx.fragment())
- .build())
+ .setSummary(queryCtx.summary())
+ .build()
+ } else {
Review Comment:
Is this really an unconditional else?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]