I want to use functions in column
class of SparkR
, but I can't find the detail explanation of functions like cbrt
, hypot
or like
. Typing ?cbrt
will return useless information.
Anywhere I can find details of the these column functions?
I want to use functions in column
class of SparkR
, but I can't find the detail explanation of functions like cbrt
, hypot
or like
. Typing ?cbrt
will return useless information.
Anywhere I can find details of the these column functions?
Good place to start is usually an official API documentation. If some function is not properly documented for a language you use you it's worth a try to check if a documentation for an another language (Python, Scala) doesn't provide a better explanation:
cbrt
- computes the cube-root of the given valuehypot
- computes sqrt(a^2 + b^2) like
- is equivalent to SQL LIKE
operatordf <- createDataFrame(sqlContext,
data.frame(x=c("foo", "bar", "foobar"), y=c(1, 8, 27), z=c(-1, 5, 10)))
select(df, df$y, cbrt(df$y)) %>% head()
## y CBRT(y)
## 1 1 1
## 2 8 2
## 3 27 3
select(df, hypot(df$y, df$z)) %>% head()
## HYPOT(y, z)
## 1 1.414214
## 2 9.433981
## 3 28.792360
select(df, df$x, like(df$x, "%ar"), like(df$x, "foo%")) %>% head()
## x (x LIKE %ar) (x LIKE foo%)
## 1 foo FALSE TRUE
## 2 bar TRUE FALSE
## 3 foobar TRUE TRUE