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

    https://github.com/apache/spark/pull/9099#discussion_r44858385
  
    --- 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 --
    
    @zero323, I don't understand the meaning here. could you give me an example?
    
    An experiment like:
    ```
    mapply(list, c(1:2), list(list(3,4),list(5,6)), SIMPLIFY=FALSE)
    ```
    works as expected. The combination of atomic vector and list works fine for 
mapply.
    
    I would recommend to eliminate this code piece here so that this PR focus 
on performance improvement only.


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