The same as in standard Spark, you can use either rlike
(Java regular expressions):
df <- copy_to(sc, iris)
df %>% filter(rlike(Species, "osa"))
# or anchored
df %>% filter(rlike(Species, "^.*osa.*$"))
or like
(simple SQL regular expressions):
df %>% filter(like(Species, "%osa%"))
Both methods can be also used with suffix notation as
df %>% filter(Species %rlike% "^.*osa.*$")
and
df %>% filter(Species %like% "%osa%")
respectively.
For details see vignette("sql-translation")
.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…