Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-20345

Fix STS error handling logic on HiveSQLException

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.6.3, 2.1.0
    • Fix Version/s: 2.2.0, 2.3.0
    • Component/s: SQL
    • Labels:
      None

      Description

      SPARK-5100 added Spark Thrift Server UI and the following logic to handle exceptions on case `Throwable`.

              HiveThriftServer2.listener.onStatementError(
                statementId, e.getMessage, SparkUtils.exceptionString(e))
      

      However, there occurred a missed case after implementing SPARK-6964's `Support Cancellation in the Thrift Server` by adding case `HiveSQLException` before case `Throwable`.

      Logically, we had better add `HiveThriftServer2.listener.onStatementError` on case `HiveSQLException`, too.

            case e: HiveSQLException =>
              if (getStatus().getState() == OperationState.CANCELED) {
                return
              } else {
                setState(OperationState.ERROR)
                throw e
              }
            // Actually do need to catch Throwable as some failures don't inherit from Exception and
            // HiveServer will silently swallow them.
            case e: Throwable =>
              val currentState = getStatus().getState()
              logError(s"Error executing query, currentState $currentState, ", e)
              setState(OperationState.ERROR)
              HiveThriftServer2.listener.onStatementError(
                statementId, e.getMessage, SparkUtils.exceptionString(e))
              throw new HiveSQLException(e.toString)
      

        Attachments

          Activity

            People

            • Assignee:
              dongjoon Dongjoon Hyun
              Reporter:
              dongjoon Dongjoon Hyun
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: