You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by rxin <gi...@git.apache.org> on 2016/12/22 01:35:26 UTC
[GitHub] spark pull request #16379: [SPARK-18969][SQL] Support grouping by nondetermi...
GitHub user rxin opened a pull request:
https://github.com/apache/spark/pull/16379
[SPARK-18969][SQL] Support grouping by nondeterministic expressions - WIP
## What changes were proposed in this pull request?
WIP
## How was this patch tested?
Added a new test suite PullOutNondeterministicSuite to cover the new case and existing cases.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/rxin/spark group-by-nondeter
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/16379.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #16379
----
commit ac81d953608faa8792297400be03d71c816afb0d
Author: Reynold Xin <rx...@databricks.com>
Date: 2016-12-22T01:33:47Z
[SPARK-18969][SQL] Support grouping by nondeterministic expressions
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #16379: [SPARK-18969][SQL] Support grouping by nondeterministic ...
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/16379
**[Test build #70499 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/70499/testReport)** for PR 16379 at commit [`ac81d95`](https://github.com/apache/spark/commit/ac81d953608faa8792297400be03d71c816afb0d).
* This patch **fails Scala style tests**.
* This patch merges cleanly.
* This patch adds no public classes.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #16379: [SPARK-18969][SQL] Support grouping by nondeterministic ...
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/16379
Merged build finished. Test FAILed.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #16379: [SPARK-18969][SQL] Support grouping by nondeterministic ...
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/16379
Test FAILed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/70499/
Test FAILed.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request #16379: [SPARK-18969][SQL] Support grouping by nondetermi...
Posted by rxin <gi...@git.apache.org>.
Github user rxin commented on a diff in the pull request:
https://github.com/apache/spark/pull/16379#discussion_r93560851
--- Diff: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/PullOutNondeterministicSuite.scala ---
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.spark.sql.catalyst.analysis
+
+import org.apache.spark.sql.catalyst.dsl.expressions._
+import org.apache.spark.sql.catalyst.dsl.plans._
+import org.apache.spark.sql.catalyst.expressions._
+import org.apache.spark.sql.catalyst.plans.logical.LocalRelation
+
+/**
+ * Test suite for moving non-deterministic expressions into Project.
+ */
+class PullOutNondeterministicSuite extends AnalysisTest {
+
+ private lazy val a = 'a.int
+ private lazy val b = 'b.int
+ private lazy val r = LocalRelation(a, b)
+ private lazy val rnd = Rand(10).as('_nondeterministic)
+ private lazy val rndref = rnd.toAttribute
+
+ test("no-op on filter") {
+ checkAnalysis(
+ r.where(Rand(10) > Literal(1.0)),
+ r.where(Rand(10) > Literal(1.0))
+ )
+ }
+
+ test("sort") {
+ checkAnalysis(
+ r.sortBy(SortOrder(Rand(10), Ascending)),
+ r.select(a, b, rnd).sortBy(SortOrder(rndref, Ascending)).select(a, b)
+ )
+ }
+
+ test("aggregate") {
+ checkAnalysis(
+ r.groupBy(rnd)(rnd),
+ r.select(a, b, rnd).groupBy(rndref)(rndref)
--- End diff --
failure
```
[info] - aggregate *** FAILED *** (22 milliseconds)
[info] == FAIL: Plans do not match ===
[info] !Aggregate [_nondeterministic#0], [_nondeterministic#0 AS _nondeterministic#0] Aggregate [_nondeterministic#0], [_nondeterministic#0]
[info] +- Project [a#0, b#0, rand(10) AS _nondeterministic#0] +- Project [a#0, b#0, rand(10) AS _nondeterministic#0]
[info] +- LocalRelation <empty>, [a#0, b#0] +- LocalRelation <empty>, [a#0, b#0] (PlanTest.scala:95)
```
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request #16379: [SPARK-18969][SQL] Support grouping by nondetermi...
Posted by rxin <gi...@git.apache.org>.
Github user rxin commented on a diff in the pull request:
https://github.com/apache/spark/pull/16379#discussion_r93553212
--- Diff: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/PullOutNondeterministicSuite.scala ---
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.spark.sql.catalyst.analysis
+
+import org.apache.spark.sql.catalyst.dsl.expressions._
+import org.apache.spark.sql.catalyst.dsl.plans._
+import org.apache.spark.sql.catalyst.expressions._
+import org.apache.spark.sql.catalyst.plans.logical.LocalRelation
+
+/**
+ * Test suite for moving non-deterministic expressions into Project.
+ */
+class PullOutNondeterministicSuite extends AnalysisTest {
+
+ private lazy val a = 'a.int
+ private lazy val b = 'b.int
+ private lazy val r = LocalRelation(a, b)
+ private lazy val rnd = Rand(10).as('_nondeterministic)
+ private lazy val rndref = rnd.toAttribute
+
+ test("no-op on filter") {
+ checkAnalysis(
+ r.where(Rand(10) > Literal(1.0)),
+ r.where(Rand(10) > Literal(1.0))
+ )
+ }
+
+ test("sort") {
+ checkAnalysis(
+ r.sortBy(SortOrder(Rand(10), Ascending)),
+ r.select(a, b, rnd).sortBy(SortOrder(rndref, Ascending)).select(a, b)
+ )
+ }
+
+ test("aggregate") {
+ checkAnalysis(
+ r.groupBy(rnd)(rnd),
+ r.select(a, b, rnd).groupBy(rndref)(rndref)
--- End diff --
@cloud-fan any idea why this test case fail?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark issue #16379: [SPARK-18969][SQL] Support grouping by nondeterministic ...
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/16379
**[Test build #70499 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/70499/testReport)** for PR 16379 at commit [`ac81d95`](https://github.com/apache/spark/commit/ac81d953608faa8792297400be03d71c816afb0d).
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org
[GitHub] spark pull request #16379: [SPARK-18969][SQL] Support grouping by nondetermi...
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/spark/pull/16379
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org