Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
jiangxb1987 committed Oct 15, 2016
1 parent 1558d4c commit 388443d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,9 @@ abstract class QueryPlan[PlanType <: QueryPlan[PlanType]] extends TreeNode[PlanT
// `UnaryNode.getAliasedConstraints` applies and may produce a non-converging set of
// constraints.
// For more details, refer to https://issues.apache.org/jira/browse/SPARK-17733
val aliasSet = AttributeSet((expressions ++ children.flatMap(_.expressions))
.filter(_.isInstanceOf[Alias]))
val aliasSet = AttributeSet((expressions ++ children.flatMap(_.expressions)).collect {
case a: Alias => a.toAttribute
})

var inferredConstraints = Set.empty[Expression]
constraints.foreach {
Expand Down
18 changes: 11 additions & 7 deletions sql/core/src/test/scala/org/apache/spark/sql/SQLQuerySuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@ package org.apache.spark.sql

import java.io.File
import java.math.MathContext
import java.sql.{Date, Timestamp}
import java.sql.Timestamp

import scala.concurrent.duration._

import org.scalatest.concurrent.Eventually._

import org.apache.spark.{AccumulatorSuite, SparkException}
import org.apache.spark.sql.catalyst.analysis.UnresolvedException
import org.apache.spark.sql.catalyst.expressions.SortOrder
import org.apache.spark.sql.catalyst.plans.logical.Aggregate
import org.apache.spark.sql.catalyst.util.StringUtils
import org.apache.spark.sql.execution.aggregate
import org.apache.spark.sql.execution.joins.{BroadcastHashJoinExec, CartesianProductExec, SortMergeJoinExec}
Expand Down Expand Up @@ -2684,7 +2685,7 @@ class SQLQuerySuite extends QueryTest with SharedSQLContext {
spark.range(10).toDF("a").createTempView("tmpv")

// Just ensure the following query will successfully execute complete.
assert(sql(
val query =
"""
|SELECT
| *
Expand All @@ -2698,8 +2699,11 @@ class SQLQuerySuite extends QueryTest with SharedSQLContext {
|) t1
|INNER JOIN tmpv t2
|ON (((t2.a) = (t1.a)) AND ((t2.a) = (t1.int_col))) AND ((t2.a) = (t1.b))
""".stripMargin).count() > 0
)
""".stripMargin

eventually(timeout(60 seconds)) {
assert(sql(query).count() > 0)
}
}
}
}

0 comments on commit 388443d

Please sign in to comment.