Skip to contents

Select from a SparkDataFrame using a set of SQL expressions.

Usage

selectExpr(x, expr, ...)

# S4 method for SparkDataFrame,character
selectExpr(x, expr, ...)

Arguments

x

A SparkDataFrame to be selected from.

expr

A string containing a SQL expression

...

Additional expressions

Value

A SparkDataFrame

Note

selectExpr since 1.4.0

Examples

if (FALSE) {
sparkR.session()
path <- "path/to/file.json"
df <- read.json(path)
selectExpr(df, "col1", "(col2 * 5) as newCol")
}