You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by holdenk <gi...@git.apache.org> on 2017/03/06 16:25:18 UTC

[GitHub] spark pull request #17100: [SPARK-13947][PYTHON][SQL] PySpark DataFrames: Th...

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

    https://github.com/apache/spark/pull/17100#discussion_r104455520
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CheckAnalysis.scala ---
    @@ -338,11 +338,29 @@ trait CheckAnalysis extends PredicateHelper {
             operator match {
               case o if o.children.nonEmpty && o.missingInput.nonEmpty =>
                 val missingAttributes = o.missingInput.mkString(",")
    -            val input = o.inputSet.mkString(",")
    +            val availableAttributes = o.inputSet.mkString(",")
    +            val missingAttributesHelper = o.missingInput.map(a => (a.name, a.exprId.id))
    +
    +            val availableAttributesHelper = o.inputSet.map(a => (a.name, a.exprId.id))
    +
    +            val common = (missingAttributesHelper ++ availableAttributesHelper).groupBy(_._1)
    +            val commonNames = common.map(x => (x._1, x._2.toSet))
    +              .filter(_._2.size > 1)
    +              .map(_._1)
    +
    +            val repeatedNameHint = if (commonNames.size > 0) {
    +              s"\n|Observe that attribute(s) ${commonNames.mkString(",")} appear in your " +
    +                "query with at least two different hashes, but same name."
    +            } else {
    +              ""
    +            }
     
                 failAnalysis(
    -              s"resolved attribute(s) $missingAttributes missing from $input " +
    -                s"in operator ${operator.simpleString}")
    +              s"|Some resolved attribute(s) are not present among available attributes " +
    --- End diff --
    
    This is really long, would maybe """ + stripMargin be easier to write/read?


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