Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-37935 Migrate onto error classes
  3. SPARK-40018

Output SparkThrowable to SQL golden files in JSON format

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.4.0
    • 3.4.0
    • SQL
    • None

    Description

      Output content of SparkThrowable in the JSON format instead of plain text.

      For instance, replace:

      [INVALID_ARRAY_INDEX_IN_ELEMENT_AT] The index 5 is out of bounds. The array has 3 elements. Use `try_element_at` to tolerate accessing element at invalid index and return NULL instead. If necessary set "spark.sql.ansi.enabled" to "false" to bypass this error.
      == SQL(line 1, position 8) ==
      select element_at(array(1, 2, 3), 5)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      

      by

      {"errorClass":"INVALID_ARRAY_INDEX_IN_ELEMENT_AT","messageParameters":["5","3","\"spark.sql.ansi.enabled\""],"queryContext":[{"objectType":"","objectName":"","startIndex":7,"stopIndex":35,"fragment":"element_at(array(1, 2, 3), 5"}]}
      

      Attachments

        Activity

          People

            maxgekk Max Gekk
            maxgekk Max Gekk
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: