详细的 SparkR 文档

SparkR documentation in detail

我想使用SparkRcolumnclass中的函数,但是找不到cbrthypot等函数的详细解释] 或 like。输入 ?cbrt 将 return 无用的信息。

我在哪里可以找到这些列函数的详细信息?

好的起点通常是 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) 没有提供更好的解释:

  • cbrt - 计算给定值的立方根
  • hypot - 计算 sqrt(a^2 + b^2)
  • like - 相当于 SQL LIKE 运算符

df <- 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