You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by blbradley <gi...@git.apache.org> on 2016/01/27 01:59:04 UTC
[GitHub] spark pull request: [SPARK-12749][SQL] add json option to parse fl...
GitHub user blbradley opened a pull request:
https://github.com/apache/spark/pull/10936
[SPARK-12749][SQL] add json option to parse floating-point types as DecimalType
I tried to add this via `USE_BIG_DECIMAL_FOR_FLOATS` option from Jackson with no success.
Added test for non-complex types. Should I add a test for complex types?
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/blbradley/spark spark-12749
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/10936.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 #10936
----
commit 8cb660afab840d700525077d86b367c105680a0f
Author: Brandon Bradley <br...@gmail.com>
Date: 2016-01-27T00:47:14Z
[SPARK-12749][SQL] add json option to parse floating-point types as DecimalType
----
---
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: [SPARK-12749][SQL] add json option to parse fl...
Posted by blbradley <gi...@git.apache.org>.
Github user blbradley commented on the pull request:
https://github.com/apache/spark/pull/10936#issuecomment-176435017
Sweet. Anything else?
---
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: [SPARK-12749][SQL] add json option to parse fl...
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/spark/pull/10936
---
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: [SPARK-12749][SQL] add json option to parse fl...
Posted by blbradley <gi...@git.apache.org>.
Github user blbradley commented on a diff in the pull request:
https://github.com/apache/spark/pull/10936#discussion_r51051135
--- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/json/InferSchema.scala ---
@@ -135,7 +136,10 @@ private[json] object InferSchema {
DecimalType(v.precision(), v.scale())
case FLOAT | DOUBLE =>
// TODO(davies): Should we use decimal if possible?
- DoubleType
+ if (configOptions.floatAsBigDecimal) {
+ val v = parser.getDecimalValue
+ DecimalType(v.precision(), v.scale())
+ } else DoubleType
--- End diff --
@rxin I updated the code. Can you start Jenkins please?
> On Jan 26, 2016, at 7:44 PM, Reynold Xin <no...@github.com> wrote:
>
> In sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/json/InferSchema.scala:
>
> > @@ -135,7 +136,10 @@ private[json] object InferSchema {
> > DecimalType(v.precision(), v.scale())
> > case FLOAT | DOUBLE =>
> > // TODO(davies): Should we use decimal if possible?
> > - DoubleType
> > + if (configOptions.floatAsBigDecimal) {
> > + val v = parser.getDecimalValue
> > + DecimalType(v.precision(), v.scale())
> > + } else DoubleType
> add curly braces around DoubleTYpe. i.e.
>
> } else {
> DoubleTYpe
> }
> —
> Reply to this email directly or view it on GitHub.
>
---
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: [SPARK-12749][SQL] add json option to parse fl...
Posted by rxin <gi...@git.apache.org>.
Github user rxin commented on a diff in the pull request:
https://github.com/apache/spark/pull/10936#discussion_r50931235
--- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/json/InferSchema.scala ---
@@ -135,7 +136,10 @@ private[json] object InferSchema {
DecimalType(v.precision(), v.scale())
case FLOAT | DOUBLE =>
// TODO(davies): Should we use decimal if possible?
--- End diff --
remove the todo above
---
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: [SPARK-12749][SQL] add json option to parse fl...
Posted by rxin <gi...@git.apache.org>.
Github user rxin commented on a diff in the pull request:
https://github.com/apache/spark/pull/10936#discussion_r50931255
--- Diff: sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/json/InferSchema.scala ---
@@ -135,7 +136,10 @@ private[json] object InferSchema {
DecimalType(v.precision(), v.scale())
case FLOAT | DOUBLE =>
// TODO(davies): Should we use decimal if possible?
- DoubleType
+ if (configOptions.floatAsBigDecimal) {
+ val v = parser.getDecimalValue
+ DecimalType(v.precision(), v.scale())
+ } else DoubleType
--- End diff --
add curly braces around DoubleTYpe. i.e.
```
} else {
DoubleTYpe
}
```
---
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: [SPARK-12749][SQL] add json option to parse fl...
Posted by AmplabJenkins <gi...@git.apache.org>.
Github user AmplabJenkins commented on the pull request:
https://github.com/apache/spark/pull/10936#issuecomment-175320473
Can one of the admins verify this patch?
---
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: [SPARK-12749][SQL] add json option to parse fl...
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:
https://github.com/apache/spark/pull/10936#issuecomment-175860200
**[Test build #2467 has finished](https://amplab.cs.berkeley.edu/jenkins/job/NewSparkPullRequestBuilder/2467/consoleFull)** for PR 10936 at commit [`c344359`](https://github.com/apache/spark/commit/c344359df44167abbb1528ee20ff12e730896452).
* This patch **fails Scala style tests**.
* This patch **does not merge 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 pull request: [SPARK-12749][SQL] add json option to parse fl...
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:
https://github.com/apache/spark/pull/10936#issuecomment-176397649
**[Test build #2469 has started](https://amplab.cs.berkeley.edu/jenkins/job/NewSparkPullRequestBuilder/2469/consoleFull)** for PR 10936 at commit [`f141097`](https://github.com/apache/spark/commit/f141097d8f2a307950eec12481d30c12928be855).
---
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: [SPARK-12749][SQL] add json option to parse fl...
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:
https://github.com/apache/spark/pull/10936#issuecomment-175859804
**[Test build #2467 has started](https://amplab.cs.berkeley.edu/jenkins/job/NewSparkPullRequestBuilder/2467/consoleFull)** for PR 10936 at commit [`c344359`](https://github.com/apache/spark/commit/c344359df44167abbb1528ee20ff12e730896452).
---
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: [SPARK-12749][SQL] add json option to parse fl...
Posted by blbradley <gi...@git.apache.org>.
Github user blbradley commented on the pull request:
https://github.com/apache/spark/pull/10936#issuecomment-176338205
@rxin can you start the test again?
---
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: [SPARK-12749][SQL] add json option to parse fl...
Posted by SparkQA <gi...@git.apache.org>.
Github user SparkQA commented on the pull request:
https://github.com/apache/spark/pull/10936#issuecomment-176434261
**[Test build #2469 has finished](https://amplab.cs.berkeley.edu/jenkins/job/NewSparkPullRequestBuilder/2469/consoleFull)** for PR 10936 at commit [`f141097`](https://github.com/apache/spark/commit/f141097d8f2a307950eec12481d30c12928be855).
* 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 pull request: [SPARK-12749][SQL] add json option to parse fl...
Posted by rxin <gi...@git.apache.org>.
Github user rxin commented on the pull request:
https://github.com/apache/spark/pull/10936#issuecomment-176478692
Thanks - I've merged this.
---
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: [SPARK-12749][SQL] add json option to parse fl...
Posted by blbradley <gi...@git.apache.org>.
Github user blbradley commented on the pull request:
https://github.com/apache/spark/pull/10936#issuecomment-176321781
I had an unused import. My apologies!
---
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