-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
SQL: Implement IN(value1, value2, ...) expression. #34581
Merged
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
36dca6d
SQL: Implement IN(value1, value2, ...) expression.
matriv 8c3beb3
Fix painless script to handle `'` in string values.
matriv 527f83b
Fix failing test, reset static variables
matriv ba330de
Added check for compatible data types
matriv 548bbd8
[TEST] Reduce forecast disk space requirement for tests (#34552)
droberts195 27b18c4
Amazon: Wrap at 140 columns (#34495)
nik9000 bbf87de
Fix line longer than 140 characters in Murmur3FieldMapper
imotov 00b832a
Fixing line lengths in murmur3 and hdfs plugins (#34603)
benwtrent 56cd0de
Change wording for FIPS 140-2 (#34471)
jkakavas 5ed4a2b
[Rollup] Add support for date histo `format` (#34537)
polyfractal fd3b8e0
Address comments
matriv 4cecd50
Merge remote-tracking branch 'upstream/master' into mt/impl-in-32955
matriv 7b26347
Added docs reference
matriv f536820
Merge remote-tracking branch 'upstream/master' into mt/impl-in-32955
matriv 27fdd06
Fix tests
matriv a73615e
Address comments, remove duplicates from IN list
matriv 1088454
Merge remote-tracking branch 'upstream/master' into mt/impl-in-32955
matriv 6b4ddf1
Address comments
matriv f9dfc8f
Merge remote-tracking branch 'upstream/master' into mt/impl-in-32955
matriv 0359faf
Merge remote-tracking branch 'upstream/master' into mt/impl-in-32955
matriv 89abace
Merge remote-tracking branch 'upstream/master' into mt/impl-in-32955
matriv d1e1018
Added test
matriv 98e1da1
Merge remote-tracking branch 'upstream/master' into mt/impl-in-32955
matriv 9fc60b2
add more tests
matriv 73b0e1d
Merge remote-tracking branch 'upstream/master' into mt/impl-in-32955
matriv d09e171
Merge remote-tracking branch 'upstream/master' into mt/impl-in-32955
matriv File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,12 +5,16 @@ | |
*/ | ||
package org.elasticsearch.xpack.sql.expression.predicate.operator.comparison; | ||
|
||
import java.util.Set; | ||
|
||
/** | ||
* Comparison utilities. | ||
*/ | ||
abstract class Comparisons { | ||
public final class Comparisons { | ||
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. Minor nitpick, I tend to explicitly use |
||
|
||
private Comparisons() {} | ||
|
||
static Boolean eq(Object l, Object r) { | ||
public static Boolean eq(Object l, Object r) { | ||
Integer i = compare(l, r); | ||
return i == null ? null : i.intValue() == 0; | ||
} | ||
|
@@ -35,6 +39,10 @@ static Boolean gte(Object l, Object r) { | |
return i == null ? null : i.intValue() >= 0; | ||
} | ||
|
||
static Boolean in(Object l, Set<Object> r) { | ||
return r.contains(l); | ||
} | ||
|
||
/** | ||
* Compares two expression arguments (typically Numbers), if possible. | ||
* Otherwise returns null (the arguments are not comparable or at least | ||
|
@@ -73,4 +81,4 @@ private static Integer compare(Number l, Number r) { | |
|
||
return Integer.valueOf(Integer.compare(l.intValue(), r.intValue())); | ||
} | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 part would need to take into account the newly introduced null support.
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.
I already have this: #34582 to take care of null handling and add tests.