尝试在 ADLS Gen2 上创建增量 table 时出现 Databricks 错误
Databricks error while trying to create delta table on ADLS Gen2
我正在使用 Azure Databricks 在 Azure Data Lake Storage Gen2 上创建增量 table 并且 运行 出错。
代码:
dataframe.write.format("delta").mode("overwrite").option("path","abfss://<ContainerName>@<StorageAccount>.dfs.core.windows.net").saveAsTable("test_table")
错误:
IllegalArgumentException: java.net.URISyntaxException: Relative path in absolute URI: abfss://<ContainerName>@<StorageAccount>.dfs.core.windows.net_delta_log
您需要将路径设置到数据湖内的特定目录,而不是容器的顶部。类似于:
ContainerName = "container"
StorageAccount = "account"
table_path = f"abfss://{ContainerName}@{StorageAccount}.dfs.core.windows.net/test-table"
dataframe.write.format("delta").mode("overwrite")\
.option("path", table_path).saveAsTable("test_table")
我正在使用 Azure Databricks 在 Azure Data Lake Storage Gen2 上创建增量 table 并且 运行 出错。
代码:
dataframe.write.format("delta").mode("overwrite").option("path","abfss://<ContainerName>@<StorageAccount>.dfs.core.windows.net").saveAsTable("test_table")
错误:
IllegalArgumentException: java.net.URISyntaxException: Relative path in absolute URI: abfss://<ContainerName>@<StorageAccount>.dfs.core.windows.net_delta_log
您需要将路径设置到数据湖内的特定目录,而不是容器的顶部。类似于:
ContainerName = "container"
StorageAccount = "account"
table_path = f"abfss://{ContainerName}@{StorageAccount}.dfs.core.windows.net/test-table"
dataframe.write.format("delta").mode("overwrite")\
.option("path", table_path).saveAsTable("test_table")