-
Notifications
You must be signed in to change notification settings - Fork 28.2k
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
[SPARK-9403][SQL] Add codegen support in In and InSet #7893
Conversation
val value = dataGen.apply() | ||
value match { | ||
case d: Double if d.isNaN => 0.0d | ||
case f: Float if f.isNaN => 0.0f |
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.
Double.NaN == Double.NaN
is false
. So here we don't use it.
Test build #39530 has finished for PR 7893 at commit
|
Test build #39543 has finished for PR 7893 at commit
|
Test build #39552 has finished for PR 7893 at commit
|
cc @davies for review |
@@ -97,7 +101,7 @@ case class Not(child: Expression) | |||
/** | |||
* Evaluates to `true` if `list` contains `value`. | |||
*/ | |||
case class In(value: Expression, list: Seq[Expression]) extends Predicate with CodegenFallback { | |||
case class In(value: Expression, list: Seq[Expression]) extends Predicate { |
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.
Existing: Should we check that value and element of list have the same data type?
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.
Is it ok to add a check in CheckAnalysis
for this?
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.
Yes,
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.
It's better to use ExpectedInputType, see https://github.com/apache/spark/pull/7949/files#diff-9853dcf5ce3d2ac1e94d473197ff5768R136
Test build #39701 has finished for PR 7893 at commit
|
retest this please. |
${ev.primitive} = true; | ||
} | ||
} | ||
""").foldLeft("")((a, b) => a + "\n" + b) |
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.
We usually use mkString("\n")
LGTM, except some minor comments. |
Test build #39713 has finished for PR 7893 at commit
|
Test build #208 has finished for PR 7893 at commit
|
retest this please. |
Test build #225 has finished for PR 7893 at commit
|
Jenkins looks like unstable... |
retest this please. |
Test build #39846 has finished for PR 7893 at commit
|
Test build #1350 has finished for PR 7893 at commit
|
Test build #228 has finished for PR 7893 at commit
|
Test build #39833 has finished for PR 7893 at commit
|
LGTM, merging this into master and 1.5 branch, thanks! |
This continues tarekauel's work in #7778. Author: Liang-Chi Hsieh <viirya@appier.com> Author: Tarek Auel <tarek.auel@googlemail.com> Closes #7893 from viirya/codegen_in and squashes the following commits: 81ff97b [Liang-Chi Hsieh] For comments. 47761c6 [Liang-Chi Hsieh] Merge remote-tracking branch 'upstream/master' into codegen_in cf4bf41 [Liang-Chi Hsieh] For comments. f532b3c [Liang-Chi Hsieh] Merge remote-tracking branch 'upstream/master' into codegen_in 446bbcd [Liang-Chi Hsieh] Fix bug. b3d0ab4 [Liang-Chi Hsieh] Merge remote-tracking branch 'upstream/master' into codegen_in 4610eff [Liang-Chi Hsieh] Relax the types of references and update optimizer test. 224f18e [Liang-Chi Hsieh] Beef up the test cases for In and InSet to include all primitive data types. 86dc8aa [Liang-Chi Hsieh] Only convert In to InSet when the number of items in set is more than the threshold. b7ded7e [Tarek Auel] [SPARK-9403][SQL] codeGen in / inSet (cherry picked from commit e1e0587) Signed-off-by: Davies Liu <davies.liu@gmail.com>
This continues @tarekauel's work in #7778.