在Zeppelin上使用Scala regex进行火花预处理

时间:2018-08-14 17:42:16

标签: scala apache-spark apache-zeppelin

为了用(project properties) (configuration properties) (general) (platform toolset) 预处理事件日志,我需要使用spark+zeppelin从较大的字符串值中提取特定的字符串。但是,这总是返回错误。我是regex的新手,这是我的代码,在scala中运行:

zeppelin web console

接下来我跑

%spark val df3= df2.map{ i => val wholeMessage = i.getAs[string]("_className") if (wholeMessage=="data.User") userId = wholeMessage.withColumn("message", regexp_extract(display name=($"message",(\D)(\[A-Za-z])+(\D)\w+\s+\w+(\D))) (userId) }.toDF("userId")

并返回以下错误:

%spark userId.show(false)

0 个答案:

没有答案