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

Improve the error for pivoting of unsupported value types

    XMLWordPrintableJSON

Details

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

    Description

      The error message from:

        test("Improve the error for pivoting of unsupported value types") {
          trainingSales
            .groupBy($"sales.year")
            .pivot(struct(lower($"sales.course"), $"training"))
            .agg(sum($"sales.earnings"))
            .show(false)
        }
      

      can confuse users:

      The feature is not supported: literal for '[dotnet,Dummies]' of class org.apache.spark.sql.catalyst.expressions.GenericRowWithSchema.
      org.apache.spark.SparkRuntimeException: The feature is not supported: literal for '[dotnet,Dummies]' of class org.apache.spark.sql.catalyst.expressions.GenericRowWithSchema.
      	at org.apache.spark.sql.errors.QueryExecutionErrors$.literalTypeUnsupportedError(QueryExecutionErrors.scala:245)
      	at org.apache.spark.sql.catalyst.expressions.Literal$.apply(literals.scala:99)
      	at org.apache.spark.sql.RelationalGroupedDataset.$anonfun$pivot$2(RelationalGroupedDataset.scala:455)
      	at scala.collection.TraversableLike.$anonfun$map$1(TraversableLike.scala:286)
      

      Need to improve the error message and make it more precise.

      See https://github.com/apache/spark/pull/35302#discussion_r793629370

      Attachments

        Activity

          People

            YActs Yuto Akutsu
            maxgekk Max Gekk
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: