Skip to content

Commit

Permalink
fix style
Browse files Browse the repository at this point in the history
  • Loading branch information
cloud-fan committed Jun 1, 2015
1 parent 69ca3fe commit 1524ff6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,8 @@ case class CaseWhen(branches: Seq[Expression]) extends CaseWhenLike {
if (!whenList.forall(_.dataType == BooleanType)) {
TypeCheckResult.fail(s"WHEN expressions should all be boolean type")
} else if (!valueTypesEqual) {
TypeCheckResult.fail("THEN and ELSE expressions should all be same type or coercible to a common type")
TypeCheckResult.fail(
"THEN and ELSE expressions should all be same type or coercible to a common type")
} else {
TypeCheckResult.success
}
Expand Down Expand Up @@ -387,7 +388,8 @@ case class CaseKeyWhen(key: Expression, branches: Seq[Expression]) extends CaseW

override def checkInputDataTypes(): TypeCheckResult = {
if (!valueTypesEqual) {
TypeCheckResult.fail("THEN and ELSE expressions should all be same type or coercible to a common type")
TypeCheckResult.fail(
"THEN and ELSE expressions should all be same type or coercible to a common type")
} else {
TypeCheckResult.success
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ class ExpressionTypeCheckingSuite extends FunSuite {
val e = intercept[AnalysisException] {
checkAnalysis(expr)
}
assert(e.getMessage.contains(s"cannot resolve '${expr.prettyString}' due to data type mismatch:"))
assert(e.getMessage.contains(
s"cannot resolve '${expr.prettyString}' due to data type mismatch:"))
assert(e.getMessage.contains(errorMessage))
}

Expand All @@ -58,7 +59,7 @@ class ExpressionTypeCheckingSuite extends FunSuite {
checkAnalysis(Multiply('a, 'b))
checkAnalysis(Divide('a, 'b))
checkAnalysis(Remainder('a, 'b))
//checkAnalysis(BitwiseAnd('a, 'b))
// checkAnalysis(BitwiseAnd('a, 'b))

val msg = "differing types in BinaryArithmetic, IntegerType != BooleanType"
checkError(Add('a, 'c), msg)
Expand Down

0 comments on commit 1524ff6

Please sign in to comment.