【发布时间】:2020-10-08 10:25:42
【问题描述】:
我收到以下语法错误
SyntaxError: invalid syntax
File "<command-3092209798892761>", line 6
.agg(avg("sale_price").as("average_price"))
^
使用以下代码:
t1.join(t2, Seq("make", "model"))\
.filter(abs(t2("engine_size") - t1("engine_size")) <= BigDecimal("0.1"))\
.groupBy("registration")\
.agg(avg("sale_price").as("average_price"))
谁能帮忙解释一下这个错误
【问题讨论】:
-
作为python中保存的关键字,你确定这是你要运行的函数吗?
-
嗨@Mogi,感谢您与我们联系。是的,如果我尝试运行,我需要它作为示例。另外,您能告诉我函数 Seq() 的作用/含义吗?
-
您能解释一下为什么会出现语法错误吗?
-
为了您的信息,我从这里得到了代码coxautomotivedatasolutions.github.io/datadriven/spark/…
-
ahhhhh .... 我只是想,代码可能需要用 Scala 编写吗?