You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by shivaram <gi...@git.apache.org> on 2016/09/07 04:11:35 UTC

[GitHub] spark pull request #14783: SPARK-16785 R dapply doesn't return array or raw ...

Github user shivaram commented on a diff in the pull request:

    https://github.com/apache/spark/pull/14783#discussion_r77757807
  
    --- Diff: R/pkg/R/utils.R ---
    @@ -697,3 +697,18 @@ is_master_local <- function(master) {
     is_sparkR_shell <- function() {
       grepl(".*shell\\.R$", Sys.getenv("R_PROFILE_USER"), perl = TRUE)
     }
    +
    +# rbind a list of rows with raw (binary) columns
    +#
    +# @param inputData a list of rows, with each row a list
    +# @return data.frame with raw columns as lists
    +rbindRaws <- function(inputData){
    +  row1 <- inputData[[1]]
    +  rawcolumns <- ("raw" == sapply(row1, class))
    +
    +  listmatrix <- do.call(rbind, inputData)
    --- End diff --
    
    Do you know what happens if we have a mixed set of columns here ? i.e. say one column with "raw", one with "integer" and one with "character" -- From reading some docs it looks like everything is converted to create a `character` matrix when we use `rbind`. 
    
    I think we have two choices if thats the case 
    (a) we apply the type conversions after `rbind` 
    (b) we only call this method when all columns are `raw`


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org