Skip to content

Commit

Permalink
For comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
viirya committed Jul 31, 2015
1 parent 7463398 commit 005ee0c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,11 @@ trait CheckAnalysis {
case p: Predicate =>
p.asInstanceOf[Expression].children.foreach(checkValidJoinConditionExprs)
case e if e.dataType.isInstanceOf[BinaryType] =>
failAnalysis(s"expression ${e.prettyString} in join condition " +
s"'${condition.prettyString}' can't be binary type.")
failAnalysis(s"binary type expression ${e.prettyString} cannot be used " +
"in join conditions")
case e if e.dataType.isInstanceOf[MapType] =>
failAnalysis(s"expression ${e.prettyString} in join condition " +
s"'${condition.prettyString}' can't be map type.")
failAnalysis(s"map type expression ${e.prettyString} cannot be used " +
"in join conditions")
case _ => // OK
}

Expand All @@ -117,11 +117,11 @@ trait CheckAnalysis {

def checkValidGroupingExprs(expr: Expression): Unit = expr.dataType match {
case BinaryType =>
failAnalysis(s"grouping expression '${expr.prettyString}' in aggregate can " +
s"not be binary type.")
failAnalysis(s"binary type expression ${expr.prettyString} cannot be used " +
"in grouping expression")
case m: MapType =>
failAnalysis(s"grouping expression '${expr.prettyString}' in aggregate can " +
s"not be map type.")
failAnalysis(s"map type expression ${expr.prettyString} cannot be used " +
"in grouping expression")
case _ => // OK
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ class AnalysisErrorSuite extends SparkFunSuite with BeforeAndAfter {
val error = intercept[AnalysisException] {
caseSensitiveAnalyze(plan)
}
assert(error.message.contains("grouping expression 'a' in aggregate can not be binary type"))
assert(error.message.contains("binary type expression a cannot be used in grouping expression"))

val plan2 =
Aggregate(
Expand All @@ -210,7 +210,7 @@ class AnalysisErrorSuite extends SparkFunSuite with BeforeAndAfter {
val error2 = intercept[AnalysisException] {
caseSensitiveAnalyze(plan2)
}
assert(error2.message.contains("grouping expression 'a' in aggregate can not be map type"))
assert(error2.message.contains("map type expression a cannot be used in grouping expression"))
}

test("Join can't work on binary and map types") {
Expand All @@ -229,7 +229,7 @@ class AnalysisErrorSuite extends SparkFunSuite with BeforeAndAfter {
val error = intercept[AnalysisException] {
caseSensitiveAnalyze(plan)
}
assert(error.message.contains("expression a in join condition '(a = c)' can't be binary type"))
assert(error.message.contains("binary type expression a cannot be used in join conditions"))

val plan2 =
Join(
Expand All @@ -246,6 +246,6 @@ class AnalysisErrorSuite extends SparkFunSuite with BeforeAndAfter {
val error2 = intercept[AnalysisException] {
caseSensitiveAnalyze(plan2)
}
assert(error2.message.contains("expression a in join condition '(a = c)' can't be map type"))
assert(error2.message.contains("map type expression a cannot be used in join conditions"))
}
}

0 comments on commit 005ee0c

Please sign in to comment.