名称 'spark_write_parquet' 未定义 - 在 python/databricks/spark 中写入镶木地板文件时出错

name 'spark_write_parquet' is not defined - error while writing parquet file in python/databricks/spark

我在写入 parquet 文件时出现以下错误 名称 'spark_write_parquet' 未定义

我需要导入任何东西来定义这个命令吗? 请帮助

没有名为 spark_write_parquet 的函数!至少先参考 documentation and the API 总是好的!

df.select("name", "age").write.save("namesAndAges.parquet", format="parquet")

df.write.parquet(os.path.join(tempfile.mkdtemp(), 'data'))