Github user sun-rui commented on a diff in the pull request:

    https://github.com/apache/spark/pull/9099#discussion_r44858522
  
    --- Diff: R/pkg/R/SQLContext.R ---
    @@ -90,19 +96,31 @@ createDataFrame <- function(sqlContext, data, schema = 
NULL, samplingRatio = 1.0
           if (is.null(schema)) {
             schema <- names(data)
           }
    -      n <- nrow(data)
    -      m <- ncol(data)
    -      # get rid of factor type
    -      dropFactor <- function(x) {
    +
    +      # types that should be wrapped before
    +      # mapply to avoid flattening
    +      requires_wrapping <- c("list")
    +
    +      # get rid of factor type and adjust for lists
    +      cleanCols <- function(x) {
             if (is.factor(x)) {
               as.character(x)
    +        } else if(class(x) %in% requires_wrapping) {
    --- End diff --
    
    ah, I think you were trying to emulating a behavior of a bug when creating 
a DataFrame from a data.frame having any column of list type. Actually, this 
bug is https://issues.apache.org/jira/browse/SPARK-11283 reported by you:)
    
    So this PR not only is a performance improvement, but also fixes 
SPARK-11283.
    
    please remove code piece here:)  


---
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]

Reply via email to