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

percentile_cont gets internal error when user input fails runtime replacement's input type check

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.3.2, 3.4.1, 3.5.0, 4.0.0
    • 3.5.1
    • SQL

    Description

      This query throws an internal error rather than producing a useful error message:

      select percentile_cont(b) WITHIN GROUP (ORDER BY a DESC) as x 
      from (values (12, 0.25), (13, 0.25), (22, 0.25)) as (a, b);
      
      [INTERNAL_ERROR] Cannot resolve the runtime replaceable expression "percentile_cont(a, b)". The replacement is unresolved: "percentile(a, b, 1)".
      org.apache.spark.SparkException: [INTERNAL_ERROR] Cannot resolve the runtime replaceable expression "percentile_cont(a, b)". The replacement is unresolved: "percentile(a, b, 1)".
      	at org.apache.spark.SparkException$.internalError(SparkException.scala:92)
      	at org.apache.spark.SparkException$.internalError(SparkException.scala:96)
      	at org.apache.spark.sql.catalyst.analysis.CheckAnalysis.$anonfun$checkAnalysis0$6(CheckAnalysis.scala:313)
      	at org.apache.spark.sql.catalyst.analysis.CheckAnalysis.$anonfun$checkAnalysis0$6$adapted(CheckAnalysis.scala:277)
      ...
      

      It should instead inform the user that the input expression must be foldable.

      PercentileCont does not check the user's input. If the runtime replacement (an instance of Percentile) rejects the user's input, the runtime replacement ends up unresolved.

      Attachments

        Issue Links

          Activity

            People

              bersprockets Bruce Robbins
              bersprockets Bruce Robbins
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: