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

Fix ArrayIndexOutOfBoundsException in conv()

    XMLWordPrintableJSON

Details

    Description

      scala> sql(s"SELECT CONV('${Long.MinValue}', 10, -2)").show(false)
      java.lang.ArrayIndexOutOfBoundsException: -1
        at org.apache.spark.sql.catalyst.util.NumberConverter$.convert(NumberConverter.scala:183)
        at org.apache.spark.sql.catalyst.expressions.Conv.nullSafeEval(mathExpressions.scala:463)
        at org.apache.spark.sql.catalyst.expressions.TernaryExpression.eval(Expression.scala:821)
        at org.apache.spark.sql.catalyst.expressions.ToPrettyString.eval(ToPrettyString.scala:57)
        at org.apache.spark.sql.catalyst.optimizer.ConstantFolding$.org$apache$spark$sql$catalyst$optimizer$ConstantFolding$$constantFolding(expressions.scala:81)
        at org.apache.spark.sql.catalyst.optimizer.ConstantFolding$.$anonfun$constantFolding$4(expressions.scala:91)
      

      Attachments

        Issue Links

          Activity

            People

              markj-db Mark Jarvin
              jira.shegalov Gera Shegalov
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: