Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Removed println.
  • Loading branch information
rxin committed Jun 11, 2015
commit 35fce15b0aa70d33d29a81c24ba93e72203aec5e
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,6 @@ trait HiveTypeCoercion {
// Convert If(null literal, _, _) into boolean type.
// In the optimizer, we should short-circuit this directly into false value.
case i @ If(pred, left, right) if pred.dataType == NullType =>
println("fireing this rule")
i.makeCopy(Array(Literal.create(null, BooleanType), left, right))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this special case? Also, I'd just use Ifinstead of makeCopy here and above. Make copy is nice when you are matching on different but structurally similar expression, but looses compile time checks for arguments.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"if(null, true, false)" gets a nulltype.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about

case i @ If (pred, _, _) if pred.dataType == NullType =>
  i.copy(predicate = Literal.create(null, BooleanType))

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

}
}
Expand Down