最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

How to create blank file in abfss using dbutils in Databricks Azure - Stack Overflow

programmeradmin5浏览0评论

I want to create a blank file in abfss using databricks dbutils command. The reason is I want to open a blank file to write filenames and the below command is not working saying file does not exist. manifestfilePath is the abfss_path+filename

with open(manifestfilePath, 'w') as manifestfile:

Big thanks for your help

I want to create a blank file in abfss using databricks dbutils command. The reason is I want to open a blank file to write filenames and the below command is not working saying file does not exist. manifestfilePath is the abfss_path+filename

with open(manifestfilePath, 'w') as manifestfile:

Big thanks for your help

Share Improve this question asked Jan 20 at 18:52 Raj RRaj R 11 bronze badge 1
  • you can use dbutils.fs.put() to create a blank file and write content to it. – Dileep Raj Narayan Thumula Commented Jan 21 at 3:31
Add a comment  | 

1 Answer 1

Reset to default 0

I have tried the below approach:

spark.conf.set("fs.azure.account.key.allnewsynp.dfs.core.windows.net", "<YOUR ADLS ACCESS KEY>")
file_path = "abfss://[email protected]/output/manifest.txt"
dbutils.fs.put(file_path, "", overwrite=True)

Results:

Wrote 0 bytes.
True

In the above code setting the configuration for ADLS using access key. Defining the file path Next creating a blank file at the specified path.

发布评论

评论列表(0)

  1. 暂无评论