-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-8203] [SPARK-8204] [SQL] conditional function: least/greatest #6851
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
ec625b0
c1f6824
7a6bdbb
0f1bff2
86fb049
22e8f3d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 { | ||
| require(children.length > 1, "LEAST requires at least 2 arguments, got " + children.length) | ||
|
|
||
| override def nullable: Boolean = children.forall(_.nullable) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. shouldn't least be nullable if any is nullable?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hive 1.2.0 only return null when all arguments are null.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If any child is not nullable, the result will not be nullable. |
||
|
|
@@ -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) | ||
|
|
||
There was a problem hiding this comment.
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.