Github user felixcheung commented on a diff in the pull request: https://github.com/apache/spark/pull/9769#discussion_r45419720 --- Diff: R/pkg/R/DataFrame.R --- @@ -717,25 +717,30 @@ setMethod("collect", # data of complex type can be held. But getting a cell from a column # of list type returns a list instead of a vector. So for columns of # non-complex type, append them as vector. + # + # For columns of complex type, be careful to access them. + # Get a column of complex type returns a list. + # Get a cell from a column of complex type returns a list instead of a vector. col <- listCols[[colIndex]] if (length(col) <= 0) { df[[names[colIndex]]] <- col } else { # TODO: more robust check on column of primitive types - vec <- do.call(c, col) - if (class(vec) != "list") { - df[[names[colIndex]]] <- vec + if (!any(sapply(col, function(e) { length(e) > 1 }))) { --- End diff -- should this be returned from org.apache.spark.sql.api.r.SQLUtils.dfToCols for more optimal processing? this seems like potentially a lot of data to go through
--- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org