Skip to content

Commit 13a2313

Browse files
authored
HIVE-28793: Set default expiry time for query history snapshots (#5666)
1 parent be89c46 commit 13a2313

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

ql/src/java/org/apache/hadoop/hive/ql/queryhistory/repository/IcebergRepository.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ protected Table createTable(Hive hive, Database db) throws HiveException {
8989
ICEBERG_STORAGE_HANDLER);
9090
table.setProperty("table_type", "ICEBERG");
9191
table.setProperty("write.format.default", "orc");
92+
// set the default max snapshot age to 1 day for query history
93+
// this is applied only during table creation, it can be manually altered afterward.
94+
table.setProperty("history.expire.max-snapshot-age-ms", Integer.toString(24 * 60 * 60 * 1000));
9295
table.setProperty(hive_metastoreConstants.META_TABLE_NAME, QUERY_HISTORY_DB_TABLE_NAME);
9396

9497
table.setFields(schema.getFields());

0 commit comments

Comments
 (0)