ICEBERG_META
デスクリプション
iceberg_meta Table値関数(tvf)は、icebergメタデータ、操作履歴、Tableのスナップショット、ファイルメタデータなどを読み取るために使用されます。
Syntax
ICEBERG_META(
"table" = "<table>",
"query_type" = "<query_type>"
);
必要なパラメータ
iceberg_metaTable関数(tvf)の各パラメータは"key"="value"ペアです。
| フィールド | 説明 |
|---|---|
<table> | 完全なTable名で、表示したいIcebergTableに対してdatabase_name.table_nameの形式で指定する必要があります。 |
<query_type> | 表示したいメタデータのタイプ。現在はsnapshotsのみがサポートされています。 |
例
-
スナップショット用のicebergタブラーメタデータを読み取りアクセスします。
select * from iceberg_meta("table" = "ctl.db.tbl", "query_type" = "snapshots"); -
desc functionと組み合わせて使用できます:desc function iceberg_meta("table" = "ctl.db.tbl", "query_type" = "snapshots"); -
iceberg Tableスナップショットを検査する:
select * from iceberg_meta("table" = "iceberg_ctl.test_db.test_tbl", "query_type" = "snapshots");+------------------------+----------------+---------------+-----------+-------------------+------------------------------+
| committed_at | snapshot_id | parent_id | operation | manifest_list | summary |
+------------------------+----------------+---------------+-----------+-------------------+------------------------------+
| 2022-09-20 11:14:29 | 64123452344 | -1 | append | hdfs:/path/to/m1 | {"flink.job-id":"xxm1", ...} |
| 2022-09-21 10:36:35 | 98865735822 | 64123452344 | overwrite | hdfs:/path/to/m2 | {"flink.job-id":"xxm2", ...} |
| 2022-09-21 21:44:11 | 51232845315 | 98865735822 | overwrite | hdfs:/path/to/m3 | {"flink.job-id":"xxm3", ...} |
+------------------------+----------------+---------------+-----------+-------------------+------------------------------+ -
snapshot_id でフィルタリング :
select * from iceberg_meta("table" = "iceberg_ctl.test_db.test_tbl", "query_type" = "snapshots") where snapshot_id = 98865735822;+------------------------+----------------+---------------+-----------+-------------------+------------------------------+
| committed_at | snapshot_id | parent_id | operation | manifest_list | summary |
+------------------------+----------------+---------------+-----------+-------------------+------------------------------+
| 2022-09-21 10:36:35 | 98865735822 | 64123452344 | overwrite | hdfs:/path/to/m2 | {"flink.job-id":"xxm2", ...} |
+------------------------+----------------+---------------+-----------+-------------------+------------------------------+