powered by
An expression that returns a substring.
# S4 method for Column substr(x, start, stop)
a Column.
starting position. It should be 1-base.
ending position.
Other colum_func: alias(), between(), cast(), endsWith(), otherwise(), over(), startsWith()
alias()
between()
cast()
endsWith()
otherwise()
over()
startsWith()
# NOT RUN { df <- createDataFrame(list(list(a="abcdef"))) collect(select(df, substr(df$a, 1, 4))) # the result is `abcd`. collect(select(df, substr(df$a, 2, 4))) # the result is `bcd`. # }
Run the code above in your browser using DataLab