GitHub user dongjoon-hyun opened a pull request:
https://github.com/apache/spark/pull/14096
[SPARK-16425][R] `describe()` should consider numeric/string-type columns
## What changes were proposed in this pull request?
This PR prevents ERRORs when `summary(df)` is called for `SparkDataFrame`
with not-numeric or non-string columns. This failure happens only in `SparkR`.
**Before**
```r
> df <- createDataFrame(faithful)
> df <- withColumn(df, "boolean", df$waiting==79)
> summary(df)
16/07/07 14:15:16 ERROR RBackendHandler: describe on 34 failed
Error in invokeJava(isStatic = FALSE, objId$id, methodName, ...) :
org.apache.spark.sql.AnalysisException: cannot resolve 'avg(`boolean`)'
due to data type mismatch: function average requires numeric types, not
BooleanType;
```
**After**
```r
> df <- createDataFrame(faithful)
> df <- withColumn(df, "boolean", df$waiting==79)
> summary(df)
SparkDataFrame[summary:string, eruptions:string, waiting:string]
```
## How was this patch tested?
Pass the Jenkins with a updated testcase.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/dongjoon-hyun/spark SPARK-16425
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/spark/pull/14096.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 #14096
----
commit f0bd1d63f5aa4b1ad812a083563409308fab3d42
Author: Dongjoon Hyun <[email protected]>
Date: 2016-07-07T21:57:59Z
[SPARK-16425][R] `describe()` should consider numeric/string-type columns
----
---
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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]