[jira] [Commented] (SPARK-17665) SparkR does not support options in other types consistently other APIs

2016-09-26 Thread Felix Cheung (JIRA)

[ 
https://issues.apache.org/jira/browse/SPARK-17665?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15523844#comment-15523844
 ] 

Felix Cheung commented on SPARK-17665:
--

supporting just character and logical seem fine.
AFAIK we don't support numerical values in Spark properties (only their string 
form) - so we might not need to take the additional steps there.

> SparkR does not support options in other types consistently other APIs
> --
>
> Key: SPARK-17665
> URL: https://issues.apache.org/jira/browse/SPARK-17665
> Project: Spark
>  Issue Type: Improvement
>  Components: SparkR
>Affects Versions: 2.0.0
>Reporter: Hyukjin Kwon
>Priority: Minor
>
> Currently, SparkR only supports a string as option in some APIs such as 
> `read.df`/`write.df` and etc.
> It'd be great if they support other types consistently with 
> Python/Scala/Java/SQL APIs.
> - Python supports all types but converts it to string
> - Scala/Java/SQL - Long/Boolean/String/Double.
> Currently, 
> {code}
> > read.df("text.json", "csv", inferSchema=FALSE)
> {code}
> throws an exception as below:
> {code}
> Error in value[[3L]](cond) :
>   Error in invokeJava(isStatic = TRUE, className, methodName, ...): 
> java.lang.ClassCastException: java.lang.Boolean cannot be cast to 
> java.lang.String
>   at 
> org.apache.spark.sql.internal.SessionState$$anonfun$newHadoopConfWithOptions$1.apply(SessionState.scala:59)
>   at 
> org.apache.spark.sql.internal.SessionState$$anonfun$newHadoopConfWithOptions$1.apply(SessionState.scala:59)
>   at scala.collection.immutable.Map$Map3.foreach(Map.scala:161)
>   at 
> org.apache.spark.sql.internal.SessionState.newHadoopConfWithOptions(SessionState.scala:59)
>   at 
> org.apache.spark.sql.execution.datasources.PartitioningAwareFileCatalog.(PartitioningAwareFileCatalog.scala:45)
>   at 
> org.apache.spark.sql.execution.datasources.ListingFileCatalog.(ListingFileCatalog.scala:45)
>   at 
> org.apache.spark.sql.execution.datasources.DataSource.resolveRelation(DataSource.scala:401)
>   at org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:149)
>   at org.apache.spark.sql.DataFrameReader.lo
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org



[jira] [Commented] (SPARK-17665) SparkR does not support options in other types consistently other APIs

2016-09-26 Thread Apache Spark (JIRA)

[ 
https://issues.apache.org/jira/browse/SPARK-17665?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15522398#comment-15522398
 ] 

Apache Spark commented on SPARK-17665:
--

User 'HyukjinKwon' has created a pull request for this issue:
https://github.com/apache/spark/pull/15239

> SparkR does not support options in other types consistently other APIs
> --
>
> Key: SPARK-17665
> URL: https://issues.apache.org/jira/browse/SPARK-17665
> Project: Spark
>  Issue Type: Improvement
>  Components: SparkR
>Affects Versions: 2.0.0
>Reporter: Hyukjin Kwon
>Priority: Minor
>
> Currently, SparkR only supports a string as option in some APIs such as 
> `read.df`/`write.df` and etc.
> It'd be great if they support other types consistently with 
> Python/Scala/Java/SQL APIs.
> - Python supports all types but converts it to string
> - Scala/Java/SQL - Long/Boolean/String/Double.
> Currently, 
> {code}
> > read.df("text.json", "csv", inferSchema=FALSE)
> {code}
> throws an exception as below:
> {code}
> Error in value[[3L]](cond) :
>   Error in invokeJava(isStatic = TRUE, className, methodName, ...): 
> java.lang.ClassCastException: java.lang.Boolean cannot be cast to 
> java.lang.String
>   at 
> org.apache.spark.sql.internal.SessionState$$anonfun$newHadoopConfWithOptions$1.apply(SessionState.scala:59)
>   at 
> org.apache.spark.sql.internal.SessionState$$anonfun$newHadoopConfWithOptions$1.apply(SessionState.scala:59)
>   at scala.collection.immutable.Map$Map3.foreach(Map.scala:161)
>   at 
> org.apache.spark.sql.internal.SessionState.newHadoopConfWithOptions(SessionState.scala:59)
>   at 
> org.apache.spark.sql.execution.datasources.PartitioningAwareFileCatalog.(PartitioningAwareFileCatalog.scala:45)
>   at 
> org.apache.spark.sql.execution.datasources.ListingFileCatalog.(ListingFileCatalog.scala:45)
>   at 
> org.apache.spark.sql.execution.datasources.DataSource.resolveRelation(DataSource.scala:401)
>   at org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:149)
>   at org.apache.spark.sql.DataFrameReader.lo
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org



[jira] [Commented] (SPARK-17665) SparkR does not support options in other types consistently other APIs

2016-09-26 Thread Hyukjin Kwon (JIRA)

[ 
https://issues.apache.org/jira/browse/SPARK-17665?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15522372#comment-15522372
 ] 

Hyukjin Kwon commented on SPARK-17665:
--

Let me please open a PR and then talk there as it would be a small fix to 
restrict types!

> SparkR does not support options in other types consistently other APIs
> --
>
> Key: SPARK-17665
> URL: https://issues.apache.org/jira/browse/SPARK-17665
> Project: Spark
>  Issue Type: Improvement
>  Components: SparkR
>Affects Versions: 2.0.0
>Reporter: Hyukjin Kwon
>Priority: Minor
>
> Currently, SparkR only supports a string as option in some APIs such as 
> `read.df`/`write.df` and etc.
> It'd be great if they support other types consistently with 
> Python/Scala/Java/SQL APIs.
> - Python supports all types but converts it to string
> - Scala/Java/SQL - Long/Boolean/String/Double.
> Currently, 
> {code}
> > read.df("text.json", "csv", inferSchema=FALSE)
> {code}
> throws an exception as below:
> {code}
> Error in value[[3L]](cond) :
>   Error in invokeJava(isStatic = TRUE, className, methodName, ...): 
> java.lang.ClassCastException: java.lang.Boolean cannot be cast to 
> java.lang.String
>   at 
> org.apache.spark.sql.internal.SessionState$$anonfun$newHadoopConfWithOptions$1.apply(SessionState.scala:59)
>   at 
> org.apache.spark.sql.internal.SessionState$$anonfun$newHadoopConfWithOptions$1.apply(SessionState.scala:59)
>   at scala.collection.immutable.Map$Map3.foreach(Map.scala:161)
>   at 
> org.apache.spark.sql.internal.SessionState.newHadoopConfWithOptions(SessionState.scala:59)
>   at 
> org.apache.spark.sql.execution.datasources.PartitioningAwareFileCatalog.(PartitioningAwareFileCatalog.scala:45)
>   at 
> org.apache.spark.sql.execution.datasources.ListingFileCatalog.(ListingFileCatalog.scala:45)
>   at 
> org.apache.spark.sql.execution.datasources.DataSource.resolveRelation(DataSource.scala:401)
>   at org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:149)
>   at org.apache.spark.sql.DataFrameReader.lo
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org



[jira] [Commented] (SPARK-17665) SparkR does not support options in other types consistently other APIs

2016-09-26 Thread Hyukjin Kwon (JIRA)

[ 
https://issues.apache.org/jira/browse/SPARK-17665?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15522331#comment-15522331
 ] 

Hyukjin Kwon commented on SPARK-17665:
--

You are so fast! How about numeric types? Actually, I was about to submit a PR 
supporting them.

Could you please tell me your concern in more details? I thought it'd be okay 
because I thought we are only supporting string types and supporting more types 
would be fine.

I was thinking the similar logics with Python which is.. 
-https://github.com/apache/spark/blob/25a020be99b6a540e4001e59e40d5d1c8aa53812/python/pyspark/sql/readwriter.py#L33-L44

> SparkR does not support options in other types consistently other APIs
> --
>
> Key: SPARK-17665
> URL: https://issues.apache.org/jira/browse/SPARK-17665
> Project: Spark
>  Issue Type: Improvement
>  Components: SparkR
>Affects Versions: 2.0.0
>Reporter: Hyukjin Kwon
>Priority: Minor
>
> Currently, SparkR only supports a string as option in some APIs such as 
> `read.df`/`write.df` and etc.
> It'd be great if they support other types consistently with 
> Python/Scala/Java/SQL APIs.
> - Python supports all types but converts it to string
> - Scala/Java/SQL - Long/Boolean/String/Double.
> Currently, 
> {code}
> > read.df("text.json", "csv", inferSchema=FALSE)
> {code}
> throws an exception as below:
> {code}
> Error in value[[3L]](cond) :
>   Error in invokeJava(isStatic = TRUE, className, methodName, ...): 
> java.lang.ClassCastException: java.lang.Boolean cannot be cast to 
> java.lang.String
>   at 
> org.apache.spark.sql.internal.SessionState$$anonfun$newHadoopConfWithOptions$1.apply(SessionState.scala:59)
>   at 
> org.apache.spark.sql.internal.SessionState$$anonfun$newHadoopConfWithOptions$1.apply(SessionState.scala:59)
>   at scala.collection.immutable.Map$Map3.foreach(Map.scala:161)
>   at 
> org.apache.spark.sql.internal.SessionState.newHadoopConfWithOptions(SessionState.scala:59)
>   at 
> org.apache.spark.sql.execution.datasources.PartitioningAwareFileCatalog.(PartitioningAwareFileCatalog.scala:45)
>   at 
> org.apache.spark.sql.execution.datasources.ListingFileCatalog.(ListingFileCatalog.scala:45)
>   at 
> org.apache.spark.sql.execution.datasources.DataSource.resolveRelation(DataSource.scala:401)
>   at org.apache.spark.sql.DataFrameReader.load(DataFrameReader.scala:149)
>   at org.apache.spark.sql.DataFrameReader.lo
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org