更新时间:2026-11-23 GMT+08:00

Iceberg表服务函数

Iceberg表服务函数仅9.1.2及以上集群版本支持。

gs_iceberg_snapshots(foreigntable regclass)

描述:查看Iceberg表快照历史记录。

返回值类型:record

函数返回字段:

表1 gs_iceberg_snapshots(foreigntable regclass)返回字段

名称

类型

描述

sequence_number

bigint

快照序列号。

snapshot_id

bigint

快照ID。

create_time

timestamp with time zone

快照创建时间。

parent_id

bigint

父快照ID。

operation

text

操作类型(APPEND/OVERWRITE/DELETE)。

manifest_list

text

manifest list文件路径。

summary

text

快照摘要(JSON)。

gs_iceberg_schemas(foreigntable regclass)

描述:查看Iceberg表DDL信息。

返回值类型:record

函数返回字段:

表2 gs_iceberg_schemas(foreigntable regclass)返回字段

名称

类型

描述

schema_id

integer

schema版本ID。

field_id

integer

字段ID。

field_name

text

字段名。

field_type

text

字段类型。

gs_iceberg_partition_specs(foreigntable regclass)

描述:查看Iceberg表分区键。

返回值类型:record

函数返回字段:

表3 gs_iceberg_partition_specs(foreigntable regclass)返回字段

名称

类型

描述

spec_id

integer

分区规格ID。

field_id

integer

分区字段ID。

field_name

text

分区字段名。

transform

text

变换函数(identity/hour/day等)。

source_field_id

integer

源字段ID。

gs_iceberg_refs(foreigntable regclass)

描述:查看Iceberg表快照引用信息。

返回值类型:record

函数返回字段:

表4 gs_iceberg_refs(foreigntable regclass)返回字段

名称

类型

描述

name

text

引用名(BRANCH/TAG名)。

type

text

引用类型(BRANCH/TAG)。

snapshot_id

bigint

指向的快照ID。

max_ref_age_ms

bigint

引用最大保留时间(毫秒)。

min_snapshots_to_keep

integer

最少保留快照数。

max_snapshot_age_ms

bigint

快照最大保留时间(毫秒)。

gs_iceberg_manifests(foreigntable regclass)

描述:查看Iceberg表清单文件。

返回值类型:record

函数返回字段:

表5 gs_iceberg_manifests(foreigntable regclass)返回字段

名称

类型

描述

path

text

manifest文件路径。

length

bigint

文件大小(字节)。

partition_spec_id

integer

分区规格ID。

added_snapshot_id

bigint

添加该manifest的快照ID。

added_data_files_count

integer

新增数据文件数。

existing_data_files_count

integer

已有数据文件数。

deleted_data_files_count

integer

删除数据文件数。

added_delete_files_count

integer

新增删除文件数。

existing_delete_files_count

integer

已有删除文件数。

deleted_delete_files_count

integer

已删除的删除文件数。

content

integer

内容类型(0=data, 1=deletes)。

partition_summaries

text

分区摘要(JSON)。

gs_iceberg_partitions(foreigntable regclass)

描述:查看Iceberg表分区统计信息。

返回值类型:record

函数返回字段:

表6 gs_iceberg_partitions(foreigntable regclass)返回字段

名称

类型

描述

partition

text

分区值。

spec_id

integer

分区规格ID。

record_count

bigint

记录数。

file_count

integer

文件数。

total_data_file_size_in_bytes

bigint

数据文件总大小(字节)。

position_delete_record_count

bigint

位置删除记录数。

position_delete_file_count

integer

位置删除文件数。

equality_delete_record_count

bigint

等值删除记录数。

equality_delete_file_count

integer

等值删除文件数。

last_updated_at

timestamp with time zone

最后更新时间。

last_updated_snapshot_id

bigint

最后更新快照ID。

small_file_count

bigint

小文件数。

gs_iceberg_manifest_entries(foreigntable regclass)

描述:查看Iceberg表清单文件状态条目。

返回值类型:record

函数返回字段:

表7 gs_iceberg_manifest_entries(foreigntable regclass)返回字段

名称

类型

描述

status

integer

状态(1=EXISTING, 2=ADDED, 3=DELETED)。

snapshot_id

bigint

快照ID。

sequence_number

bigint

序列号。

file_sequence_number

bigint

文件序列号。

data_file

text

数据文件描述(JSON)。

readable_metrics

text

可读指标(JSON)。

gs_iceberg_files(foreigntable regclass)

描述:查看Iceberg表数据文件信息。

返回值类型:record

函数返回字段:

表8 gs_iceberg_files(foreigntable regclass)返回字段

名称

类型

描述

content

integer

内容类型(0=data, 1=position-deletes, 2=equality-deletes)。

file_path

text

文件路径。

format

text

文件格式(PARQUET/ORC/AVRO)。

spec_id

integer

分区规格ID。

record_count

bigint

记录数。

file_size

bigint

文件大小(字节)。

column_sizes

text

各列大小(JSON)。

value_counts

text

各列值的计数(JSON)。

null_value_counts

text

各列NULL计数(JSON)。

nan_value_counts

text

各列NaN计数(JSON)。

lower_bounds

text

各列下界(JSON)。

upper_bounds

text

各列上界(JSON)。

gs_iceberg_history(foreigntable regclass)

描述:查看Iceberg表时间线历史。

返回值类型:record

函数返回字段:

表9 gs_iceberg_history(foreigntable regclass)返回字段

名称

类型

描述

made_current_at

timestamp with time zone

成为当前快照时间。

snapshot_id

bigint

快照ID。

parent_id

bigint

父快照ID。

is_current_ancestor

boolean

是否为当前快照的祖先。

gs_iceberg_metadata_log_entries(foreigntable regclass)

描述:查看Iceberg表元数据日志条目。

返回值类型:record

函数返回字段:

表10 gs_iceberg_metadata_log_entries(foreigntable regclass)返回字段

名称

类型

描述

time_stamp

timestamp with time zone

时间戳。

file

text

metadata JSON文件路径。

latest_snapshot_id

bigint

最新快照ID。

latest_schema_id

bigint

最新Schema ID。

latest_sequence_num

bigint

最新序列号。

gs_iceberg_pos_delete_files(foreigntable regclass)

描述:查看Iceberg表删除记录。

返回值类型:record

函数返回字段:

表11 gs_iceberg_pos_delete_files(foreigntable regclass)返回字段

名称

类型

描述

file_path

text

数据文件路径。

pos

bigint

删除位置(行号)。

partition

text

分区值。

spec_id

bigint

分区规格ID。

del_file_path

text

删除文件路径。