Github user yhuai commented on a diff in the pull request:

    https://github.com/apache/spark/pull/14353#discussion_r72182390
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/complexTypeCreator.scala
 ---
    @@ -33,13 +33,24 @@ case class CreateArray(children: Seq[Expression]) 
extends Expression {
     
       override def foldable: Boolean = children.forall(_.foldable)
     
    -  override def checkInputDataTypes(): TypeCheckResult =
    -    TypeUtils.checkForSameTypeInputExpr(children.map(_.dataType), 
"function array")
    +  override def checkInputDataTypes(): TypeCheckResult = {
    +    if (children.map(_.dataType).forall(_.isInstanceOf[DecimalType])) {
    +      TypeCheckResult.TypeCheckSuccess
    --- End diff --
    
    For example, if we access a single element, its data type actually may not 
be the one shown as the array's datatype.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

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

Reply via email to