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

Pass error message parameters to exceptions as a map

    XMLWordPrintableJSON

Details

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

    Description

      Modify Spark exception to pass message parameters as a map not an array. At the moment, we still depend on the order of parameters in error-classes.json , so, we can change the text of error messages but not the order of parameters. For example, pass Map[String, String] instead of Array[String] in exceptions like:

      private[spark] class SparkRuntimeException(
          errorClass: String,
          errorSubClass: Option[String] = None,
          messageParameters: Array[String]
          ...)
      

      It should be replaced by:

          new SparkRuntimeException(
            errorClass = "UNSUPPORTED_FEATURE",
            errorSubClass = "LITERAL_TYPE",
            messageParameters = Map(
              "value" -> v.toString,
              "type" -> v.getClass.toString))
      

      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: