我在Google dataproc集群版本1.4和spark版本2.4.5中运行spark作业,它从GS存储桶中读取路径中具有正则表达式的文件,并获取以下错误。)
at org.apache.spark.sql.execution.datasources.DataSource$$anonfun$org$apache$spark$sql$execution$datasources$DataSource$$checkAndGlob
我想从sql中获取表名(例如:select name from user where id>5)。我尝试使用正则表达式,我的模式是from\s+(.*)(\s*$|where)
当sql不包含'where‘时,这是可以的。但如果sql包含' where ',我将得到'user where id>5‘作为答案。因为sql可能没有'where',所以我使用$,但是(.