You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用DBR 13.3 LTS向Unity Catalog写入Delta表时userMetadata丢失问题

DBR 13.3 LTS中Unity Catalog Delta表saveAsTable方法的userMetadata参数不生效

在DBR 13.3 LTS版本中,使用saveAsTable方法将Delta表写入Unity Catalog时,通过.option("userMetadata", "test")指定的元数据并未被写入表中。

复现代码

from pyspark.sql.types import StructType, StructField, IntegerType, StringType
from pyspark.sql.functions import lit

schema = StructType([
  StructField("id", IntegerType(), True),
  StructField("name", StringType(), True),
  StructField("age", IntegerType(), True)])

data = [(1, "Alice", 25),
        (2, "Bob", 30),
        (3, "Charlie", 35)]

df = spark.createDataFrame(data, schema)

(df
 .write
 .format("delta")
 .option("userMetadata", "test")
 .saveAsTable("catalog.schema.table")
)

对比:非Unity Catalog方式可正常工作

当不使用Unity Catalog,直接通过绝对路径写入Delta表时,userMetadata参数功能正常,元数据能被正确写入:

(df
 .write
 .option("userMetadata", "test")
 .format("delta")
 .save("/dbfs/path/to/table")
 )

内容的提问来源于stack exchange,提问作者Oliver Angelil

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.11 13:16:06