【问题标题】:loading data into delta lake from azure blob storage从 azure blob 存储将数据加载到 delta Lake
【发布时间】:2019-11-11 00:37:59
【问题描述】:

我正在尝试将数据从 azure blob 存储加载到 delta Lake。 我正在使用下面的代码 sn-p

storage_account_name = "xxxxxxxxdev" storage_account_access_key = "xxxxxxxxxxxxxxxxxxxxx"

file_location = "wasbs://bicc-hdspk-eus-qc@xxxxxxxxdev.blob.core.windows.net/FSHC/DIM/FSHC_DIM_SBU"

file_type = "csv"

spark.conf.set("fs.azure.account.key."+storage_account_name+".blob.core.windows.net",storage_account_access_key)

df = spark.read.format(file_type).option("header","true").option("inferSchema", "true").option("delimiter", '|').load(file_location )

dx = df.write.format("镶木地板")

直到这一步它正在工作,我还可以将它加载到 databricks 表中。

dx.write.format("delta").save(file_location)

错误:AttributeError:'DataFrameWriter' 对象没有属性'write'

附言- 我是否将文件位置错误地传递到写入语句中?如果这是原因,那么 delta Lake 的文件路径是什么。

如果需要更多信息,请回复我。

谢谢, 阿比鲁普

【问题讨论】:

    标签: python-3.x pyspark azure-blob-storage delta-lake


    【解决方案1】:

    dx 是一个数据帧编写器,所以你试图做的事情没有意义。你可以这样做:

    df = spark.read.format(file_type).option("header","true").option("inferSchema", "true").option("delimiter", '|').load(file_location)
    
    df.write.format("parquet").save()
    df.write.format("delta").save()
    

    【讨论】:

    • 谢谢..我后来也意识到了同样的错误。现在问题解决了。
    猜你喜欢
    • 2019-04-01
    • 2022-11-24
    • 2022-12-01
    • 2017-12-16
    • 1970-01-01
    • 2021-11-25
    • 2017-08-05
    • 2020-03-15
    • 2021-09-20
    相关资源
    最近更新 更多