spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maropu <...@git.apache.org>
Subject [GitHub] spark pull request #18516: [SPARK-21281][SQL] Use string types by default if...
Date Thu, 06 Jul 2017 00:28:48 GMT
Github user maropu commented on a diff in the pull request:

    https://github.com/apache/spark/pull/18516#discussion_r125788467
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/complexTypeCreator.scala
---
    @@ -292,18 +296,23 @@ trait CreateNamedStructLike extends Expression {
       }
     
       override def checkInputDataTypes(): TypeCheckResult = {
    -    if (children.size % 2 != 0) {
    -      TypeCheckResult.TypeCheckFailure(s"$prettyName expects an even number of arguments.")
    +    if (children.length < 1) {
    +      TypeCheckResult.TypeCheckFailure(
    +        s"input to function $prettyName requires at least one argument")
         } else {
    -      val invalidNames = nameExprs.filterNot(e => e.foldable && e.dataType
== StringType)
    -      if (invalidNames.nonEmpty) {
    -        TypeCheckResult.TypeCheckFailure(
    -          "Only foldable StringType expressions are allowed to appear at odd position,
got:" +
    -          s" ${invalidNames.mkString(",")}")
    -      } else if (!names.contains(null)) {
    -        TypeCheckResult.TypeCheckSuccess
    +      if (children.size % 2 != 0) {
    --- End diff --
    
    ok


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


Mime
View raw message