From b0e3982568c10440dbbfdcf0e8dee2f3b5744be8 Mon Sep 17 00:00:00 2001 From: "shuming.li" Date: Wed, 29 May 2024 13:57:13 +0800 Subject: [PATCH] [BugFix] Fix NullPointerException in mv update meta for iceberg catalog (#46155) Signed-off-by: shuming.li --- .../com/starrocks/connector/iceberg/IcebergMetadata.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/fe/fe-core/src/main/java/com/starrocks/connector/iceberg/IcebergMetadata.java b/fe/fe-core/src/main/java/com/starrocks/connector/iceberg/IcebergMetadata.java index d5ca2c53d5a8b..bc8f18ec8760f 100644 --- a/fe/fe-core/src/main/java/com/starrocks/connector/iceberg/IcebergMetadata.java +++ b/fe/fe-core/src/main/java/com/starrocks/connector/iceberg/IcebergMetadata.java @@ -432,7 +432,13 @@ public List getPartitions(Table table, List partitionName CloseableIterable rows = task.asDataTask().rows(); for (StructLike row : rows) { // Get the last updated time of the table according to the table schema - long lastUpdated = row.get(7, Long.class); + long lastUpdated = -1; + try { + lastUpdated = row.get(7, Long.class); + } catch (NullPointerException e) { + LOG.error("The table [{}] snapshot [{}] has been expired", + icebergTable.getRemoteDbName(), icebergTable.getRemoteTableName(), e); + } Partition partition = new Partition(lastUpdated); return ImmutableList.of(partition); }