pyspark dataframe error: _() missing 1 required positional argument: 'col'
pyspark dataframe error: _() missing 1 required positional argument: 'col'
有谁知道下面这个问题是什么:
代码:
def writeDataToDBFS(data: DataFrame, dirName: str):
data.write.format("delta").mode("overwrite").save(dir + "/" + dirName)
ls = ["workspaceId"]
newls_2a = ls.copy()
newls_2a.append("date")
newls_2b = ls.copy()
Df = (DataDf.select(*(newls_2a))
.distinct()
.groupBy(*(ls)).agg(f.count().alias("numCnt")))
writeDataToDBFS(Df, "Df")
错误:
_() missing 1 required positional argument: 'col'
这解决了它:
Df = (DataDf.select(*(newls_2a))
.distinct()
.groupBy(*(ls)).agg(f.count("date").alias("numCnt")))
有谁知道下面这个问题是什么: 代码:
def writeDataToDBFS(data: DataFrame, dirName: str):
data.write.format("delta").mode("overwrite").save(dir + "/" + dirName)
ls = ["workspaceId"]
newls_2a = ls.copy()
newls_2a.append("date")
newls_2b = ls.copy()
Df = (DataDf.select(*(newls_2a))
.distinct()
.groupBy(*(ls)).agg(f.count().alias("numCnt")))
writeDataToDBFS(Df, "Df")
错误:
_() missing 1 required positional argument: 'col'
这解决了它:
Df = (DataDf.select(*(newls_2a))
.distinct()
.groupBy(*(ls)).agg(f.count("date").alias("numCnt")))