簡體   English   中英

如何使用 python 將 append 數據寫入數據塊中的現有文件?

[英]How to append data to an existing file in databricks with python?

我正在嘗試使用 python 對 DBFS 中的 append 數據進行處理,但它會拋出錯誤,有人可以幫忙嗎

#write a file to DBFS using python i/o apis
with open("/dbfs/tmp/test_dbfs.txt", 'a') as f:
  f.write("Apache Spark is awesome!\n")
  f.write("End of example!")

錯誤

[Errno 95] Operation not supported

基於 Databricks 中有關本地文件 API 的文檔:

https://docs.databricks.com/data/databricks-file-system.html?_ga=2.77331157.1317975239.1613139339-582497539339-582497487539339-582497538

運行時 6.0 有一個限制:它不支持隨機寫入

請參考文檔。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM