Skip to content

Commit

Permalink
Two minor SQL cleanup (compiler warning & indent).
Browse files Browse the repository at this point in the history
Author: Reynold Xin <rxin@databricks.com>

Closes apache#7000 from rxin/minor-cleanup and squashes the following commits:

046044c [Reynold Xin] Two minor SQL cleanup (compiler warning & indent).
  • Loading branch information
rxin committed Jun 25, 2015
1 parent b71d325 commit 82f80c1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -309,8 +309,8 @@ class Analyzer(
.nonEmpty =>
(oldVersion, oldVersion.copy(windowExpressions = newAliases(windowExpressions)))
}
// Only handle first case, others will be fixed on the next pass.
.headOption match {
// Only handle first case, others will be fixed on the next pass.
.headOption match {
case None =>
/*
* No result implies that there is a logical plan node that produces new references
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -678,8 +678,8 @@ trait HiveTypeCoercion {
findTightestCommonTypeAndPromoteToString((c.key +: c.whenList).map(_.dataType))
maybeCommonType.map { commonType =>
val castedBranches = c.branches.grouped(2).map {
case Seq(when, then) if when.dataType != commonType =>
Seq(Cast(when, commonType), then)
case Seq(whenExpr, thenExpr) if whenExpr.dataType != commonType =>
Seq(Cast(whenExpr, commonType), thenExpr)
case other => other
}.reduce(_ ++ _)
CaseKeyWhen(Cast(c.key, commonType), castedBranches)
Expand Down

0 comments on commit 82f80c1

Please sign in to comment.