You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by rberenguel <gi...@git.apache.org> on 2017/03/22 08:31:09 UTC

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

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

    https://github.com/apache/spark/pull/17100#discussion_r107354055
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/CheckAnalysis.scala ---
    @@ -337,11 +337,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."
    --- End diff --
    
    Good point!


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