spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chenghao-intel <...@git.apache.org>
Subject [GitHub] spark pull request: [SPARK-6247][SQL] Fix resolution of ambiguous ...
Date Tue, 17 Mar 2015 08:04:02 GMT
Github user chenghao-intel commented on a diff in the pull request:

    https://github.com/apache/spark/pull/5062#discussion_r26554868
  
    --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/Analyzer.scala
---
    @@ -237,22 +237,35 @@ class Analyzer(catalog: Catalog,
           // Special handling for cases when self-join introduce duplicate expression ids.
           case j @ Join(left, right, _, _) if left.outputSet.intersect(right.outputSet).nonEmpty
=>
             val conflictingAttributes = left.outputSet.intersect(right.outputSet)
    +        logDebug(s"Conflicting attributes ${conflictingAttributes.mkString(",")} in $j")
     
    -        val (oldRelation, newRelation, attributeRewrites) = right.collect {
    +        val (oldRelation, newRelation) = right.collect {
    +          // Handle base relations that might appear more than once.
               case oldVersion: MultiInstanceRelation
                   if oldVersion.outputSet.intersect(conflictingAttributes).nonEmpty =>
                 val newVersion = oldVersion.newInstance()
    -            val newAttributes = AttributeMap(oldVersion.output.zip(newVersion.output))
    -            (oldVersion, newVersion, newAttributes)
    +            (oldVersion, newVersion)
    +
    +          // Handle projects that create conflicting aliases.
    +          case oldVersion @ Project(projectList, child)
    --- End diff --
    
    Probably a doable solution is add a `Project` node on top of cached plan or temporal table
when `lookupRelation`.


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