-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-22856][SQL] Add wrappers for codegen output and nullability #20043
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
5ace8b8
d120750
81c9b6e
53926cc
69422d4
4384c84
d864aff
8715d32
f59bb19
37ae9b0
0841c4a
e530f01
c8c70a9
ac2e595
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 |
|---|---|---|
|
|
@@ -322,7 +322,7 @@ case class IsNull(child: Expression) extends UnaryExpression with Predicate { | |
|
|
||
| override def doGenCode(ctx: CodegenContext, ev: ExprCode): ExprCode = { | ||
| val eval = child.genCode(ctx) | ||
| val value = if ("true" == eval.isNull || "false" == eval.isNull) { | ||
| val value = if ("true" == s"${eval.isNull}" || "false" == s"${eval.isNull}") { | ||
|
||
| LiteralValue(eval.isNull) | ||
| } else { | ||
| VariableValue(eval.isNull) | ||
|
|
@@ -353,9 +353,9 @@ case class IsNotNull(child: Expression) extends UnaryExpression with Predicate { | |
|
|
||
| override def doGenCode(ctx: CodegenContext, ev: ExprCode): ExprCode = { | ||
| val eval = child.genCode(ctx) | ||
| val value = if ("true" == eval.isNull) { | ||
| val value = if ("true" == s"${eval.isNull}") { | ||
|
||
| LiteralValue("false") | ||
| } else if ("false" == eval.isNull) { | ||
| } else if ("false" == s"${eval.isNull}") { | ||
| LiteralValue("true") | ||
| } else { | ||
| StatementValue(s"(!(${eval.isNull}))") | ||
|
|
||
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.
this can be simplified to
!eval.isNull.instanceOf[LiteralValue]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.
oh, yea.