From 29ff58c0fa45e8e85a4895dede70f8ede15950b6 Mon Sep 17 00:00:00 2001 From: zhannngchen Date: Tue, 3 Dec 2024 12:50:12 +0800 Subject: [PATCH] [fix](unique key) getEnableUniqueKeyMergeOnWrite should check keys type (#44692) Problem Summary: Some user can create Duplicate keys table with `enable_unique_key_merge_on_write=true` in version 1.2, when they upgrade to version 2.0, some logic in BE treat such table as an unique key mow table, make a wrong query plan, which cause BE core. In the method `OlapTable::getEnableUniqueKeyMergeOnWrite()`, we should check if the table is a unique key table. --- .../src/main/java/org/apache/doris/catalog/OlapTable.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fe/fe-core/src/main/java/org/apache/doris/catalog/OlapTable.java b/fe/fe-core/src/main/java/org/apache/doris/catalog/OlapTable.java index 699d62397ac834..543bd49dcbf58c 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/catalog/OlapTable.java +++ b/fe/fe-core/src/main/java/org/apache/doris/catalog/OlapTable.java @@ -2713,6 +2713,9 @@ public boolean getEnableUniqueKeyMergeOnWrite() { if (tableProperty == null) { return false; } + if (getKeysType() != KeysType.UNIQUE_KEYS) { + return false; + } return tableProperty.getEnableUniqueKeyMergeOnWrite(); }