ulysses you created SPARK-34072:
-----------------------------------

             Summary: Fix empty array failed in functions.lit()
                 Key: SPARK-34072
                 URL: https://issues.apache.org/jira/browse/SPARK-34072
             Project: Spark
          Issue Type: Bug
          Components: SQL
    Affects Versions: 3.2.0
            Reporter: ulysses you


We will get exception if we execute code:
{code:java}
spark.range(1).select(lit(Array())){code}
error msg:
{code:java}
Exception in thread "main" org.apache.spark.sql.AnalysisException: Unsupported 
component type class java.lang.Object in arrays;Exception in thread "main" 
org.apache.spark.sql.AnalysisException: Unsupported component type class 
java.lang.Object in arrays; at 
org.apache.spark.sql.catalyst.expressions.Literal$.componentTypeToDataType(literals.scala:129)
 at org.apache.spark.sql.catalyst.expressions.Literal$.apply(literals.scala:80) 
at 
org.apache.spark.sql.catalyst.expressions.Literal$.$anonfun$create$2(literals.scala:148)
 at scala.util.Failure.getOrElse(Try.scala:222) at 
org.apache.spark.sql.catalyst.expressions.Literal$.create(literals.scala:148) 
at org.apache.spark.sql.functions$.typedLit(functions.scala:132) at 
org.apache.spark.sql.functions$.lit(functions.scala:115)
{code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to