-
Notifications
You must be signed in to change notification settings - Fork 29.1k
[SPARK-27924][SQL] Support ANSI SQL Boolean-Predicate syntax #25074
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 all commits
4a9ac98
3963455
00cc822
5e72437
349d865
4ef1c12
3013cee
6629b33
a0d2d07
05d36f9
bd05be2
97e7812
782b75e
b2fc258
fa148db
c22f12d
fc207e1
3f36c0c
189e805
26c8658
d6abc38
a9cc3ce
2719224
efe5a51
bd71665
67db695
65d4100
ebd2dcf
4794b67
ae126e7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1210,6 +1210,7 @@ class AstBuilder(conf: SQLConf) extends SqlBaseBaseVisitor[AnyRef] with Logging | |
| * - (NOT) LIKE | ||
| * - (NOT) RLIKE | ||
| * - IS (NOT) NULL. | ||
| * - IS (NOT) (TRUE | FALSE | UNKNOWN) | ||
| * - IS (NOT) DISTINCT FROM | ||
| */ | ||
| private def withPredicate(e: Expression, ctx: PredicateContext): Expression = withOrigin(ctx) { | ||
|
|
@@ -1243,6 +1244,18 @@ class AstBuilder(conf: SQLConf) extends SqlBaseBaseVisitor[AnyRef] with Logging | |
| IsNotNull(e) | ||
| case SqlBaseParser.NULL => | ||
| IsNull(e) | ||
| case SqlBaseParser.TRUE => ctx.NOT match { | ||
| case null => IsTrue(e) | ||
|
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. isn't it simply
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. @cloud-fan It looks more reasonable.
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.
Member
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. Ah, I missed that approach and the @cloud-fan one sounds more reasonable. If @dongjoon-hyun is not against the idea, can you make a PR for that? @beliefer
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. @cloud-fan @maropu Let's wait @dongjoon-hyun , then I will make a PR.
Member
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. Sorry for being late. +1 for that approach.
Member
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. Thanks for the check, @dongjoon-hyun ! Plz go ahead, @beliefer
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. OK. |
||
| case _ => IsNotTrue(e) | ||
| } | ||
| case SqlBaseParser.FALSE => ctx.NOT match { | ||
| case null => IsFalse(e) | ||
| case _ => IsNotFalse(e) | ||
| } | ||
| case SqlBaseParser.UNKNOWN => ctx.NOT match { | ||
| case null => IsUnknown(e) | ||
| case _ => IsNotUnknown(e) | ||
| } | ||
| case SqlBaseParser.DISTINCT if ctx.NOT != null => | ||
| EqualNullSafe(e, expression(ctx.right)) | ||
| case SqlBaseParser.DISTINCT => | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.