You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by rdblue <gi...@git.apache.org> on 2016/11/11 00:23:59 UTC
[GitHub] spark pull request #15847: SPARK-18368: Add serialization to checkEvaluation...
GitHub user rdblue opened a pull request:
https://github.com/apache/spark/pull/15847
SPARK-18368: Add serialization to checkEvaluation.
## What changes were proposed in this pull request?
This removes the serialization test from RegexpExpressionsSuite and
replaces it by serializing all expressions in checkEvaluation.
This also fixes math constant expressions by making LeafMathExpression
Serializable and fixes NumberFormat values that are null or invalid
after serialization.
## How was this patch tested?
This patch is to tests.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/rdblue/spark SPARK-18387-fix-serializable-expressions
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/15847.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 #15847
----
commit 8e829ae87b197de2ff4b8777202a47d5f1204c56
Author: Ryan Blue <bl...@apache.org>
Date: 2016-11-09T00:16:11Z
SPARK-18368: Add serialization to checkEvaluation.
This removes the serialization test from RegexpExpressionsSuite and
replaces it by serializing all expressions in checkEvaluation.
This also fixes math constant expressions by making LeafMathExpression
Serializable and fixes NumberFormat values that are null or invalid
after serialization.
----
---
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 #15847: [SPARK-18387] [SQL] Add serialization to checkEvaluation...
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/15847
Test PASSed.
Refer to this link for build results (access rights to CI server needed):
https://amplab.cs.berkeley.edu/jenkins//job/SparkPullRequestBuilder/68502/
Test PASSed.
---
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 #15847: [SPARK-18387] [SQL] Add serialization to checkEvaluation...
Posted by rxin <gi...@git.apache.org>.
Github user rxin commented on the issue:
https://github.com/apache/spark/pull/15847
Thanks. Merging in master/branch-2.1.
Can you also send a pr for branch-2.0?
---
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 #15847: [SPARK-18387] [SQL] Add serialization to checkEva...
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/spark/pull/15847
---
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 #15847: [SPARK-18387] [SQL] Add serialization to checkEva...
Posted by rxin <gi...@git.apache.org>.
Github user rxin commented on a diff in the pull request:
https://github.com/apache/spark/pull/15847#discussion_r87541254
--- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/stringExpressions.scala ---
@@ -1431,43 +1431,49 @@ case class FormatNumber(x: Expression, d: Expression)
// Associated with the pattern, for the last d value, and we will update the
// pattern (DecimalFormat) once the new coming d value differ with the last one.
+ // This is an Option to distinguish between 0 (numberFormat is valid) and uninitialized after
+ // serialization (numberFormat has not been updated for dValue = 0).
@transient
- private var lastDValue: Int = -100
+ private var lastDValue: Option[Int] = None
--- End diff --
Actually you can do this via a lazy val too, which is just
```
@transient private lazy var lastDValue: Int = -100
```
then I believe it gets initialized to -100 after deserialization automatically.
---
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 #15847: [SPARK-18387] [SQL] Add serialization to checkEvaluation...
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/15847
**[Test build #68502 has finished](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/68502/consoleFull)** for PR 15847 at commit [`8e829ae`](https://github.com/apache/spark/commit/8e829ae87b197de2ff4b8777202a47d5f1204c56).
* This patch passes all 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 #15847: [SPARK-18387] [SQL] Add serialization to checkEvaluation...
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the issue:
https://github.com/apache/spark/pull/15847
Merged build finished. Test PASSed.
---
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 #15847: [SPARK-18387] [SQL] Add serialization to checkEvaluation...
Posted by rxin <gi...@git.apache.org>.
Github user rxin commented on the issue:
https://github.com/apache/spark/pull/15847
Actually I managed to cherry pick this into branch-2.0 as well.
---
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 #15847: [SPARK-18387] [SQL] Add serialization to checkEva...
Posted by rxin <gi...@git.apache.org>.
Github user rxin commented on a diff in the pull request:
https://github.com/apache/spark/pull/15847#discussion_r87519832
--- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/stringExpressions.scala ---
@@ -1431,43 +1431,49 @@ case class FormatNumber(x: Expression, d: Expression)
// Associated with the pattern, for the last d value, and we will update the
// pattern (DecimalFormat) once the new coming d value differ with the last one.
+ // This is an Option to distinguish between 0 (numberFormat is valid) and uninitialized after
+ // serialization (numberFormat has not been updated for dValue = 0).
@transient
- private var lastDValue: Int = -100
+ private var lastDValue: Option[Int] = None
--- End diff --
any perf penalty to do it this way?
---
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 #15847: [SPARK-18387] [SQL] Add serialization to checkEva...
Posted by rxin <gi...@git.apache.org>.
Github user rxin commented on a diff in the pull request:
https://github.com/apache/spark/pull/15847#discussion_r87519874
--- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/mathExpressions.scala ---
@@ -36,7 +36,7 @@ import org.apache.spark.unsafe.types.UTF8String
* @param name The short name of the function
*/
abstract class LeafMathExpression(c: Double, name: String)
- extends LeafExpression with CodegenFallback {
+ extends LeafExpression with CodegenFallback with Serializable {
--- End diff --
does this actually matter? all expressions should be case classes, which means they are serializable.
---
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 #15847: [SPARK-18387] [SQL] Add serialization to checkEvaluation...
Posted by rdblue <gi...@git.apache.org>.
Github user rdblue commented on the issue:
https://github.com/apache/spark/pull/15847
Thanks! I just went to cherry-pick the commit, but it was already there.
---
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 #15847: [SPARK-18387] [SQL] Add serialization to checkEva...
Posted by rdblue <gi...@git.apache.org>.
Github user rdblue commented on a diff in the pull request:
https://github.com/apache/spark/pull/15847#discussion_r87620051
--- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/stringExpressions.scala ---
@@ -1431,43 +1431,49 @@ case class FormatNumber(x: Expression, d: Expression)
// Associated with the pattern, for the last d value, and we will update the
// pattern (DecimalFormat) once the new coming d value differ with the last one.
+ // This is an Option to distinguish between 0 (numberFormat is valid) and uninitialized after
+ // serialization (numberFormat has not been updated for dValue = 0).
@transient
- private var lastDValue: Int = -100
+ private var lastDValue: Option[Int] = None
--- End diff --
This is a variable so it can't be lazily initialized.
---
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 #15847: [SPARK-18387] [SQL] Add serialization to checkEvaluation...
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the issue:
https://github.com/apache/spark/pull/15847
**[Test build #68502 has started](https://amplab.cs.berkeley.edu/jenkins/job/SparkPullRequestBuilder/68502/consoleFull)** for PR 15847 at commit [`8e829ae`](https://github.com/apache/spark/commit/8e829ae87b197de2ff4b8777202a47d5f1204c56).
---
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 #15847: [SPARK-18387] [SQL] Add serialization to checkEva...
Posted by rdblue <gi...@git.apache.org>.
Github user rdblue commented on a diff in the pull request:
https://github.com/apache/spark/pull/15847#discussion_r87619721
--- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/mathExpressions.scala ---
@@ -36,7 +36,7 @@ import org.apache.spark.unsafe.types.UTF8String
* @param name The short name of the function
*/
abstract class LeafMathExpression(c: Double, name: String)
- extends LeafExpression with CodegenFallback {
+ extends LeafExpression with CodegenFallback with Serializable {
--- End diff --
The case classes are serializable, but the superclass must be also. If this isn't present, then no default constructor is created for this abstract class and its children fail when they are deserialized.
---
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