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
Next Next commit
use seq for case class
  • Loading branch information
adrian-wang committed Jul 13, 2015
commit 86fb049829b8393892d6fc0b7b47e21879fe8b20
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ case class CaseKeyWhen(key: Expression, branches: Seq[Expression]) extends CaseW
}
}

case class Least(children: Expression*) extends Expression {
case class Least(children: Seq[Expression]) extends Expression {
Copy link
Contributor

Choose a reason for hiding this comment

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

can you add scaladoc explaining the semantics of this expression? also do it for greatest.

require(children.length > 1, "LEAST requires at least 2 arguments, got " + children.length)

override def nullable: Boolean = children.forall(_.nullable)
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't least be nullable if any is nullable?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hive 1.2.0 only return null when all arguments are null.

Copy link
Contributor

Choose a reason for hiding this comment

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

If any child is not nullable, the result will not be nullable.

Expand Down Expand Up @@ -364,7 +364,7 @@ case class Least(children: Expression*) extends Expression {
}
}

case class Greatest(children: Expression*) extends Expression {
case class Greatest(children: Seq[Expression]) extends Expression {
require(children.length > 1, "GREATEST requires at least 2 arguments, got " + children.length)

override def nullable: Boolean = children.forall(_.nullable)
Expand Down