From 91ecca3903dc995add3a5a07b028bdbdf920fb79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=BF=9F=E6=88=90?= Date: Tue, 3 Nov 2020 15:22:04 +0800 Subject: [PATCH] Fix ClassCastException (#4833) --- .../src/main/java/org/apache/doris/catalog/PartitionKey.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/catalog/PartitionKey.java b/fe/fe-core/src/main/java/org/apache/doris/catalog/PartitionKey.java index 3fd0732a91ebfd..c5cc70e3a9511d 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/catalog/PartitionKey.java +++ b/fe/fe-core/src/main/java/org/apache/doris/catalog/PartitionKey.java @@ -137,11 +137,11 @@ public static int compareLiteralExpr(LiteralExpr key1, LiteralExpr key2) { try { LiteralExpr newKey = key1; if (key1.getType() != destType) { - newKey = (LiteralExpr) key1.castTo(destType); + newKey = (LiteralExpr) key1.castTo(destType).getResultValue(); } LiteralExpr newOtherKey = key2; if (key2.getType() != destType) { - newOtherKey = (LiteralExpr) key2.castTo(destType); + newOtherKey = (LiteralExpr) key2.castTo(destType).getResultValue(); } ret = newKey.compareLiteral(newOtherKey); } catch (AnalysisException e) {