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

    https://github.com/apache/spark/pull/21649#discussion_r216122842
  
    --- Diff: R/pkg/R/DataFrame.R ---
    @@ -3905,6 +3905,16 @@ setMethod("rollup",
                 groupedData(sgd)
               })
     
    +isTypeAllowedForSqlHint <- function(x) {
    +  if (is.character(x) || is.numeric(x)) {
    +    TRUE
    +  } else if (is.list(x)) {
    +    all(sapply(x, (function(y) is.character(y) || is.numeric(y))))
    --- End diff --
    
    also, if it is a `list` could we clarify if it is supposed to work with 
multiple hint in different types in that list (this might be "unique" to R), 
for example
    
    ```
    > x <- list("a", 3)
    > all(sapply(x, function(y) { is.character(y) || is.numeric(y) } ))
    [1] TRUE
    
    > x <- list("a", NA)
    > all(sapply(x, function(y) { is.character(y) || is.numeric(y) } ))
    [1] FALSE
    ```


---

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

Reply via email to