Github user felixcheung commented on the pull request:
https://github.com/apache/spark/pull/8984#issuecomment-151611692
@shivaram as I was discussing with @sun-rui in #9218 - I think coltypes()
could probably handle complex type (JVM -> R) by mapping "map<string,int>" ->
"environment", "array<string>" -> "list" but this conversion is not perfect, at
least from R -> JVM.
I can have this
```
> e <- new.env()
> e[["abd"]] <- 1276
> e[["84798"]] <- "abc"
> l <- list(e)
> df <- createDataFrame(sqlContext, list(l))
> df
DataFrame[_1:map<string,string>]
```
So `env` supports mixed type values they are mapped to `map<string,
string>` on JVM.
In fact, this DataFrame doesn't seem to work properly
```
> head(df)
15/10/27 19:02:02 ERROR Executor: Exception in task 0.0 in stage 6.0 (TID 6)
scala.MatchError: 1276.0 (of class java.lang.Double)
at
org.apache.spark.sql.catalyst.CatalystTypeConverters$StringConverter$.toCatalystImpl(CatalystTypeConverters.scala:295)
```
---
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]