From f315b45399e11f6fdf92f51878b69d5769156cac Mon Sep 17 00:00:00 2001 From: chenxu Date: Sun, 8 Oct 2023 19:29:41 +0800 Subject: [PATCH] fix meta field compatibility in partition info table Signed-off-by: chenxu --- .../com/dmetasoul/lakesoul/meta/dao/PartitionInfoDao.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lakesoul-common/src/main/java/com/dmetasoul/lakesoul/meta/dao/PartitionInfoDao.java b/lakesoul-common/src/main/java/com/dmetasoul/lakesoul/meta/dao/PartitionInfoDao.java index 76d3b6ad7..9e1af5db8 100644 --- a/lakesoul-common/src/main/java/com/dmetasoul/lakesoul/meta/dao/PartitionInfoDao.java +++ b/lakesoul-common/src/main/java/com/dmetasoul/lakesoul/meta/dao/PartitionInfoDao.java @@ -605,7 +605,8 @@ public static PartitionInfo partitionInfoFromResultSet(ResultSet rs) throws SQLE .setTimestamp(rs.getLong("timestamp")); Array snapshotArray = rs.getArray("snapshot"); partitionInfo.addAllSnapshot(Arrays.stream((UUID[]) snapshotArray.getArray()).map(DBUtil::toProtoUuid).collect(Collectors.toList())); - partitionInfo.setExpression(rs.getString("expression")); + String expr = rs.getString("expression"); + partitionInfo.setExpression(expr == null ? "" : expr); return partitionInfo.build(); } @@ -617,7 +618,8 @@ public static PartitionInfo partitionInfoFromResultSetWithoutTimestamp(ResultSet .setCommitOp(CommitOp.valueOf(rs.getString("commit_op"))); Array snapshotArray = rs.getArray("snapshot"); partitionInfo.addAllSnapshot(Arrays.stream((UUID[]) snapshotArray.getArray()).map(DBUtil::toProtoUuid).collect(Collectors.toList())); - partitionInfo.setExpression(rs.getString("expression")); + String expr = rs.getString("expression"); + partitionInfo.setExpression(expr == null ? "" : expr); return partitionInfo.build(); } }