Skip to content

[SPARK-7437][SQL] Fold "literal in (item1, item2, ..., literal, ...)" into true or false directly - #5972

Closed
pzzs wants to merge 21 commits into
apache:masterfrom
pzzs:InToFalse
Closed

[SPARK-7437][SQL] Fold "literal in (item1, item2, ..., literal, ...)" into true or false directly#5972
pzzs wants to merge 21 commits into
apache:masterfrom
pzzs:InToFalse

Conversation

@pzzs

@pzzspzzs commented May 7, 2015

Copy link
Copy Markdown
Contributor

SQL

select key from src where 3 in (4, 5);

Before

== Optimized Logical Plan ==
Project [key#12]
Filter 3 INSET (5,4)
MetastoreRelation default, src, None

After

== Optimized Logical Plan ==
LocalRelation [key#228], []

@AmplabJenkins

Copy link
Copy Markdown

Can one of the admins verify this patch?

@pzzspzzs closed this May 7, 2015
@pzzspzzs reopened this May 7, 2015
@pzzspzzs changed the title [SPARK-7437][SQL] Fold "literal in (item1, item2, ..., literal, ...)" into false directly if not in.[SPARK-7437][SQL] Fold "literal in (item1, item2, ..., literal, ...)" into true or false directly if all elements of list is LiteralMay 7, 2015
@AmplabJenkins

Copy link
Copy Markdown

Can one of the admins verify this patch?

@scwf

scwf commented May 7, 2015

Copy link
Copy Markdown
Contributor

please add a test for this

@pzzspzzs changed the title [SPARK-7437][SQL] Fold "literal in (item1, item2, ..., literal, ...)" into true or false directly if all elements of list is Literal[SPARK-7437][SQL] Fold "literal in (item1, item2, ..., literal, ...)" into true or false directlyMay 7, 2015
@pzzs

pzzs commented May 7, 2015

Copy link
Copy Markdown
ContributorAuthor

@scwf

@yhuai

yhuai commented May 7, 2015

Copy link
Copy Markdown
Contributor

ok to test

@AmplabJenkins

Copy link
Copy Markdown

Merged build triggered.

@AmplabJenkins

Copy link
Copy Markdown

Merged build started.

@SparkQA

Copy link
Copy Markdown

Test build #32117 has started for PR 5972 at commit 24739bd.

@SparkQA

Copy link
Copy Markdown

Test build #32117 has finished for PR 5972 at commit 24739bd.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA

Copy link
Copy Markdown

Test build #32174 has started for PR 5972 at commit abe2bbb.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why move it?

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because it more like a transform, i think it should before ConstantFolding @yhuai

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All of them are in the batch of "ConstantFolding". So, we do not really need to move them, right?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessary, but looks ok to me, here first do transform from in -> inset, then in ConstantFolding it will call InSet.eval (not In.eval) which should be more efficient.

@SparkQA

Copy link
Copy Markdown

Test build #32173 has finished for PR 5972 at commit fa461a5.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@AmplabJenkins

Copy link
Copy Markdown

Merged build finished. Test FAILed.

@AmplabJenkins

Copy link
Copy Markdown

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/32173/
Test FAILed.

@AmplabJenkins

Copy link
Copy Markdown

Merged build triggered.

@AmplabJenkins

Copy link
Copy Markdown

Merged build started.

@SparkQA

Copy link
Copy Markdown

Test build #32177 has started for PR 5972 at commit 4c722a2.

@SparkQA

Copy link
Copy Markdown

Test build #32174 has finished for PR 5972 at commit abe2bbb.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@AmplabJenkins

Copy link
Copy Markdown

Merged build finished. Test FAILed.

@AmplabJenkins

Copy link
Copy Markdown

Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/32174/
Test FAILed.

@SparkQA

Copy link
Copy Markdown

Test build #32177 has finished for PR 5972 at commit 4c722a2.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@AmplabJenkins

Copy link
Copy Markdown

Merged build finished. Test PASSed.

@AmplabJenkins

Copy link
Copy Markdown

Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/32177/
Test PASSed.

@pzzs

pzzs commented May 11, 2015

Copy link
Copy Markdown
ContributorAuthor

asfgit pushed a commit that referenced this pull request May 12, 2015
…" into true or false directly
SQL
```
select key from src where 3 in (4, 5);
```
Before
```
== Optimized Logical Plan ==
Project [key#12]
Filter 3 INSET (5,4)
MetastoreRelation default, src, None
```
After
```
== Optimized Logical Plan ==
LocalRelation [key#228], []
```
Author: Zhongshuai Pei <799203320@qq.com>
Author: DoingDone9 <799203320@qq.com>
Closes#5972 from DoingDone9/InToFalse and squashes the following commits:
4c722a2 [Zhongshuai Pei] Update predicates.scala
abe2bbb [Zhongshuai Pei] Update Optimizer.scala
fa461a5 [Zhongshuai Pei] Update Optimizer.scala
e34c28a [Zhongshuai Pei] Update predicates.scala
24739bd [Zhongshuai Pei] Update ConstantFoldingSuite.scala
f4dbf50 [Zhongshuai Pei] Update ConstantFoldingSuite.scala
35ceb7a [Zhongshuai Pei] Update Optimizer.scala
36c194e [Zhongshuai Pei] Update Optimizer.scala
2e8f6ca [Zhongshuai Pei] Update Optimizer.scala
14952e2 [Zhongshuai Pei] Merge pull request #13 from apache/master
f03fe7f [Zhongshuai Pei] Merge pull request #12 from apache/master
f12fa50 [Zhongshuai Pei] Merge pull request #10 from apache/master
f61210c [Zhongshuai Pei] Merge pull request #9 from apache/master
34b1a9a [Zhongshuai Pei] Merge pull request #8 from apache/master
802261c [DoingDone9] Merge pull request #7 from apache/master
d00303b [DoingDone9] Merge pull request #6 from apache/master
98b134f [DoingDone9] Merge pull request #5 from apache/master
161cae3 [DoingDone9] Merge pull request #4 from apache/master
c87e8b6 [DoingDone9] Merge pull request #3 from apache/master
cb1852d [DoingDone9] Merge pull request #2 from apache/master
c3f046f [DoingDone9] Merge pull request #1 from apache/master
(cherry picked from commit 4b5e1fe)
Signed-off-by: Michael Armbrust <michael@databricks.com>
@marmbrus

Copy link
Copy Markdown
Contributor

Thanks, merged to master and 1.4

jeanlyn pushed a commit to jeanlyn/spark that referenced this pull request May 28, 2015
…" into true or false directly
SQL
```
select key from src where 3 in (4, 5);
```
Before
```
== Optimized Logical Plan ==
Project [key#12]
Filter 3 INSET (5,4)
MetastoreRelation default, src, None
```
After
```
== Optimized Logical Plan ==
LocalRelation [key#228], []
```
Author: Zhongshuai Pei <799203320@qq.com>
Author: DoingDone9 <799203320@qq.com>
Closesapache#5972 from DoingDone9/InToFalse and squashes the following commits:
4c722a2 [Zhongshuai Pei] Update predicates.scala
abe2bbb [Zhongshuai Pei] Update Optimizer.scala
fa461a5 [Zhongshuai Pei] Update Optimizer.scala
e34c28a [Zhongshuai Pei] Update predicates.scala
24739bd [Zhongshuai Pei] Update ConstantFoldingSuite.scala
f4dbf50 [Zhongshuai Pei] Update ConstantFoldingSuite.scala
35ceb7a [Zhongshuai Pei] Update Optimizer.scala
36c194e [Zhongshuai Pei] Update Optimizer.scala
2e8f6ca [Zhongshuai Pei] Update Optimizer.scala
14952e2 [Zhongshuai Pei] Merge pull request apache#13 from apache/master
f03fe7f [Zhongshuai Pei] Merge pull request apache#12 from apache/master
f12fa50 [Zhongshuai Pei] Merge pull request apache#10 from apache/master
f61210c [Zhongshuai Pei] Merge pull request apache#9 from apache/master
34b1a9a [Zhongshuai Pei] Merge pull request apache#8 from apache/master
802261c [DoingDone9] Merge pull request apache#7 from apache/master
d00303b [DoingDone9] Merge pull request apache#6 from apache/master
98b134f [DoingDone9] Merge pull request apache#5 from apache/master
161cae3 [DoingDone9] Merge pull request apache#4 from apache/master
c87e8b6 [DoingDone9] Merge pull request apache#3 from apache/master
cb1852d [DoingDone9] Merge pull request apache#2 from apache/master
c3f046f [DoingDone9] Merge pull request apache#1 from apache/master
harishreedharan added a commit to harishreedharan/spark that referenced this pull request Jun 3, 2015
harishreedharan added a commit to harishreedharan/spark that referenced this pull request Jun 3, 2015
asfgit pushed a commit that referenced this pull request Jun 3, 2015
Replaced `fs.listFiles` with Hadoop-1 friendly `fs.listStatus` method.
Author: Hari Shreedharan <hshreedharan@apache.org>
Closes#6619 from harishreedharan/evetlog-hadoop-1-fix and squashes the following commits:
6192078 [Hari Shreedharan] [HOTFIX] Fix Hadoop-1 build caused by #5972.
jeanlyn pushed a commit to jeanlyn/spark that referenced this pull request Jun 12, 2015
…" into true or false directly
SQL
```
select key from src where 3 in (4, 5);
```
Before
```
== Optimized Logical Plan ==
Project [key#12]
Filter 3 INSET (5,4)
MetastoreRelation default, src, None
```
After
```
== Optimized Logical Plan ==
LocalRelation [key#228], []
```
Author: Zhongshuai Pei <799203320@qq.com>
Author: DoingDone9 <799203320@qq.com>
Closesapache#5972 from DoingDone9/InToFalse and squashes the following commits:
4c722a2 [Zhongshuai Pei] Update predicates.scala
abe2bbb [Zhongshuai Pei] Update Optimizer.scala
fa461a5 [Zhongshuai Pei] Update Optimizer.scala
e34c28a [Zhongshuai Pei] Update predicates.scala
24739bd [Zhongshuai Pei] Update ConstantFoldingSuite.scala
f4dbf50 [Zhongshuai Pei] Update ConstantFoldingSuite.scala
35ceb7a [Zhongshuai Pei] Update Optimizer.scala
36c194e [Zhongshuai Pei] Update Optimizer.scala
2e8f6ca [Zhongshuai Pei] Update Optimizer.scala
14952e2 [Zhongshuai Pei] Merge pull request apache#13 from apache/master
f03fe7f [Zhongshuai Pei] Merge pull request apache#12 from apache/master
f12fa50 [Zhongshuai Pei] Merge pull request apache#10 from apache/master
f61210c [Zhongshuai Pei] Merge pull request apache#9 from apache/master
34b1a9a [Zhongshuai Pei] Merge pull request apache#8 from apache/master
802261c [DoingDone9] Merge pull request apache#7 from apache/master
d00303b [DoingDone9] Merge pull request apache#6 from apache/master
98b134f [DoingDone9] Merge pull request apache#5 from apache/master
161cae3 [DoingDone9] Merge pull request apache#4 from apache/master
c87e8b6 [DoingDone9] Merge pull request apache#3 from apache/master
cb1852d [DoingDone9] Merge pull request apache#2 from apache/master
c3f046f [DoingDone9] Merge pull request apache#1 from apache/master
jeanlyn pushed a commit to jeanlyn/spark that referenced this pull request Jun 12, 2015
Replaced `fs.listFiles` with Hadoop-1 friendly `fs.listStatus` method.
Author: Hari Shreedharan <hshreedharan@apache.org>
Closesapache#6619 from harishreedharan/evetlog-hadoop-1-fix and squashes the following commits:
6192078 [Hari Shreedharan] [HOTFIX] Fix Hadoop-1 build caused by apache#5972.
nemccarthy pushed a commit to nemccarthy/spark that referenced this pull request Jun 19, 2015
…" into true or false directly
SQL
```
select key from src where 3 in (4, 5);
```
Before
```
== Optimized Logical Plan ==
Project [key#12]
Filter 3 INSET (5,4)
MetastoreRelation default, src, None
```
After
```
== Optimized Logical Plan ==
LocalRelation [key#228], []
```
Author: Zhongshuai Pei <799203320@qq.com>
Author: DoingDone9 <799203320@qq.com>
Closesapache#5972 from DoingDone9/InToFalse and squashes the following commits:
4c722a2 [Zhongshuai Pei] Update predicates.scala
abe2bbb [Zhongshuai Pei] Update Optimizer.scala
fa461a5 [Zhongshuai Pei] Update Optimizer.scala
e34c28a [Zhongshuai Pei] Update predicates.scala
24739bd [Zhongshuai Pei] Update ConstantFoldingSuite.scala
f4dbf50 [Zhongshuai Pei] Update ConstantFoldingSuite.scala
35ceb7a [Zhongshuai Pei] Update Optimizer.scala
36c194e [Zhongshuai Pei] Update Optimizer.scala
2e8f6ca [Zhongshuai Pei] Update Optimizer.scala
14952e2 [Zhongshuai Pei] Merge pull request apache#13 from apache/master
f03fe7f [Zhongshuai Pei] Merge pull request apache#12 from apache/master
f12fa50 [Zhongshuai Pei] Merge pull request apache#10 from apache/master
f61210c [Zhongshuai Pei] Merge pull request apache#9 from apache/master
34b1a9a [Zhongshuai Pei] Merge pull request apache#8 from apache/master
802261c [DoingDone9] Merge pull request apache#7 from apache/master
d00303b [DoingDone9] Merge pull request apache#6 from apache/master
98b134f [DoingDone9] Merge pull request apache#5 from apache/master
161cae3 [DoingDone9] Merge pull request apache#4 from apache/master
c87e8b6 [DoingDone9] Merge pull request apache#3 from apache/master
cb1852d [DoingDone9] Merge pull request apache#2 from apache/master
c3f046f [DoingDone9] Merge pull request apache#1 from apache/master
nemccarthy pushed a commit to nemccarthy/spark that referenced this pull request Jun 19, 2015
Replaced `fs.listFiles` with Hadoop-1 friendly `fs.listStatus` method.
Author: Hari Shreedharan <hshreedharan@apache.org>
Closesapache#6619 from harishreedharan/evetlog-hadoop-1-fix and squashes the following commits:
6192078 [Hari Shreedharan] [HOTFIX] Fix Hadoop-1 build caused by apache#5972.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@pzzs@AmplabJenkins@scwf@yhuai@SparkQA@marmbrus@rxin