This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-2.1 by this push:
new 5e5fffe4e3d Set enable_unique_key_partial_update to false in
statistics session variable. (#33220)
5e5fffe4e3d is described below
commit 5e5fffe4e3d6f83eb3c1698a373038f6cb87fb5d
Author: Jibing-Li <[email protected]>
AuthorDate: Mon Apr 8 13:42:43 2024 +0800
Set enable_unique_key_partial_update to false in statistics session
variable. (#33220)
---
.../doris/statistics/util/StatisticsUtil.java | 2 +-
.../test_statistic_partial_update.groovy | 56 ++++++++++++++++++++++
2 files changed, 57 insertions(+), 1 deletion(-)
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/statistics/util/StatisticsUtil.java
b/fe/fe-core/src/main/java/org/apache/doris/statistics/util/StatisticsUtil.java
index 090c47b00a4..f6b49522508 100644
---
a/fe/fe-core/src/main/java/org/apache/doris/statistics/util/StatisticsUtil.java
+++
b/fe/fe-core/src/main/java/org/apache/doris/statistics/util/StatisticsUtil.java
@@ -191,7 +191,6 @@ public class StatisticsUtil {
sessionVariable.parallelPipelineTaskNum =
Config.statistics_sql_parallel_exec_instance_num;
sessionVariable.setEnableNereidsPlanner(true);
sessionVariable.setEnablePipelineEngine(false);
- sessionVariable.enableProfile = false;
sessionVariable.enableScanRunSerial = limitScan;
sessionVariable.setQueryTimeoutS(StatisticsUtil.getAnalyzeTimeout());
sessionVariable.insertTimeoutS = StatisticsUtil.getAnalyzeTimeout();
@@ -199,6 +198,7 @@ public class StatisticsUtil {
sessionVariable.forbidUnknownColStats = false;
sessionVariable.enablePushDownMinMaxOnUnique = true;
sessionVariable.enablePushDownStringMinMax = true;
+ sessionVariable.enableUniqueKeyPartialUpdate = false;
connectContext.setEnv(Env.getCurrentEnv());
connectContext.setDatabase(FeConstants.INTERNAL_DB_NAME);
connectContext.setQualifiedUser(UserIdentity.ROOT.getQualifiedUser());
diff --git
a/regression-test/suites/statistics/test_statistic_partial_update.groovy
b/regression-test/suites/statistics/test_statistic_partial_update.groovy
new file mode 100644
index 00000000000..53fcf1f1b1f
--- /dev/null
+++ b/regression-test/suites/statistics/test_statistic_partial_update.groovy
@@ -0,0 +1,56 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+suite("test_statistic_partial_update", "p0, nonConcurrent") {
+ sql """drop database if exists test_statistic_partial_update""";
+ sql """create database if not exists test_statistic_partial_update"""
+ sql """use test_statistic_partial_update"""
+ sql """
+ CREATE TABLE mvTestUni (
+ key1 bigint NOT NULL,
+ key2 bigint NOT NULL,
+ value1 int NOT NULL,
+ value2 int NOT NULL,
+ value3 int NOT NULL
+ )ENGINE=OLAP
+ UNIQUE KEY(`key1`, `key2`)
+ COMMENT "OLAP"
+ DISTRIBUTED BY HASH(`key1`) BUCKETS 2
+ PROPERTIES (
+ "enable_unique_key_merge_on_write" = false,
+ "replication_num" = "1"
+ );
+ """
+ sql """set enable_unique_key_partial_update=false"""
+ sql """insert into mvTestUni values (1, 2, 3, 4, 5), (1, 2, 3, 7, 8), (1,
11, 22, 33, 44), (10, 20, 30, 40, 50), (10, 20, 30, 40, 50), (100, 200, 300,
400, 500), (1001, 2001, 3001, 4001, 5001);"""
+ sql """set global enable_unique_key_partial_update=true"""
+ try {
+ try {
+ sql """INSERT INTO internal.__internal_schema.column_statistics
VALUES
('132440--1-supplier_info',0,11833,132440,-1,'supplier_info',null,144620,1,144620,'null','null',578480,'2024-04-01
09:49:04')"""
+ } catch (Exception e) {
+ assertTrue(e.getMessage().contains("You must explicitly specify
the columns to be updated when updating partial columns using the INSERT
statement"));
+ }
+ sql """analyze table mvTestUni with sync"""
+ } finally {
+ sql """set global enable_unique_key_partial_update=false"""
+ }
+ def result = sql """show column stats mvTestUni"""
+ logger.info("result: " + result)
+ assertEquals(5, result.size())
+ sql """drop database if exists test_statistic_partial_update""";
+}
+
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]