从 pyspark 将表描述添加到 Iceberg 表

问题描述 投票:0回答:1

我可以使用 trino 将表注释添加到 Iceberg 表中,使用这个 trino 命令:

comment on table iceberg.table_schema.table_name is 'My Comment'

也可以使用以下方法从 pyspark 读取该内容:

spark.sql("describe extended iceberg.table_schema.table_name")

我找不到使用 Spark 将这些注释插入表中的方法。 有办法吗?

python pyspark apache-spark-sql hive apache-iceberg
1个回答
1
投票

我找到了一种方法可以做到这一点:

ALTER TABLE catalog.schema.table_name SET TBLPROPERTIES('comment'='a comment')

但如果可能的话,我仍然想通过 saveAsTable 来做到这一点。

© www.soinside.com 2019 - 2024. All rights reserved.