如何获取雪花表的历史记录以及如何获取雪花表的版本以及雪花表的操作

问题描述 投票:0回答:1
 select max(timestamp) from (DESCRIBE HISTORY <tablename> ) where operation = 'MERGE
```'

描述历史).orderBy(col("version").desc).first.getLong(0)



 i need to convert above 2 sql queries into snowflake sql to use in snowpark code ,I need to get exact output what the above lines of code getting in spark
sql snowflake-cloud-data-platform snowflake-schema
1个回答
0
投票

要检查表的 DDL 历史记录,可以使用常用命令“SHOW TABLES HISTORY”。

CREATE OR REPLACE TABLE test_show_tables_history(fld1 NUMBER);

DROP TABLE test_show_tables_history;
CREATE OR REPLACE TABLE test_show_tables_history(fld2 NUMBER);
SHOW TABLES HISTORY LIKE 'test_show_tables_history';
© www.soinside.com 2019 - 2024. All rights reserved.