Github user dongjoon-hyun commented on a diff in the pull request:

    https://github.com/apache/spark/pull/14353#discussion_r72186016
  
    --- 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 --
    
    In short, those are recognized correctly in the Analyzed Logical Plan. As a 
result, the codegen correctly writes it with the unified precision and scale.
    ```
    == Analyzed Logical Plan ==
    a[0]: decimal(3,3), a[1]: decimal(3,3)
    ```


---
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