You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by felixcheung <gi...@git.apache.org> on 2018/09/08 06:49:49 UTC
[GitHub] spark pull request #21649: [SPARK-23648][R][SQL]Adds more types for hint in ...
Github user felixcheung commented on a diff in the pull request:
https://github.com/apache/spark/pull/21649#discussion_r216122804
--- 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 --
I look into this more deeply, I think this style seems a bit odd, as a nit, I think this should be
`all(sapply(x, function(y) { is.character(y) || is.numeric(y) } ))`
think it's more readable this way. also see L2458 for an example https://github.com/apache/spark/blob/aec391c9dcb6362874736e663d435f9dd8400125/R/pkg/R/DataFrame.R#L2458
---
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org