Skip to content

Commit 31d7e91

Browse files
committed
[fix](fe) Preserve retired ACID session variable compatibility
### What problem does this PR solve? Related PR: #69601 Problem Summary: Clients that still set skip_checking_acid_version_file when initializing a connection encounter an unknown-variable error after the Hive ACID reader removal. Register the retired name in the existing removed-variable compatibility set so SET remains a no-op and both variable-read paths use the empty-string fallback. Do not restore the session field or the removed Hive read support. ### Release note Continue accepting the retired skip_checking_acid_version_file session variable as a compatibility no-op. ### Check List (For Author) - Test: Targeted FE unit tests and FE Checkstyle. - Behavior changed: Yes, preserve legacy client session initialization. - Does this need documentation: No.
1 parent 4db6df6 commit 31d7e91

2 files changed

Lines changed: 56 additions & 0 deletions

File tree

‎fe/fe-core/src/main/java/org/apache/doris/qe/VariableMgr.java‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ public class VariableMgr {
157157
"enable_phrase_query_sequential_opt",
158158
"enable_rust_lance_reader",
159159
"enable_paimon_cpp_reader",
160+
// Keep old connection-init SET statements valid after removing Hive ACID reads.
161+
"skip_checking_acid_version_file",
160162
"enable_nereids_trace",
161163
"nereids_trace_event_mode",
162164
"shuffled_agg_node_ids",
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
// Licensed to the Apache Software Foundation (ASF) under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The ASF licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing,
12+
// software distributed under the License is distributed on an
13+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
// KIND, either express or implied. See the License for the
15+
// specific language governing permissions and limitations
16+
// under the License.
17+
18+
package org.apache.doris.qe;
19+
20+
import org.apache.doris.analysis.BoolLiteral;
21+
import org.apache.doris.analysis.SetType;
22+
import org.apache.doris.analysis.SetVar;
23+
import org.apache.doris.analysis.VariableExpr;
24+
import org.apache.doris.catalog.Type;
25+
import org.apache.doris.nereids.trees.expressions.literal.Literal;
26+
27+
import org.junit.jupiter.api.Assertions;
28+
import org.junit.jupiter.api.Test;
29+
30+
import java.util.Locale;
31+
32+
class RemovedAcidSessionVariableTest {
33+
@Test
34+
void removedAcidVariableRemainsANoOpForSessionInitialization() throws Exception {
35+
SessionVariable variables = new SessionVariable();
36+
for (String name : new String[] {"skip_checking_acid_version_file",
37+
"skip_checking_acid_version_file".toUpperCase(Locale.ROOT)}) {
38+
for (boolean value : new boolean[] {true, false}) {
39+
SetVar setVar = new SetVar(SetType.SESSION, name, new BoolLiteral(value));
40+
Assertions.assertDoesNotThrow(() -> VariableMgr.setVar(variables, setVar));
41+
Assertions.assertDoesNotThrow(() -> VariableMgr.setVarForNonMasterFE(variables, setVar));
42+
}
43+
VariableExpr expression = new VariableExpr(name);
44+
VariableMgr.fillValue(variables, expression);
45+
Assertions.assertEquals(Type.VARCHAR, expression.getType());
46+
Assertions.assertEquals("", VariableMgr.getValue(variables, expression));
47+
Literal literal = VariableMgr.getLiteral(variables, name, SetType.SESSION);
48+
Assertions.assertNotNull(literal);
49+
Assertions.assertEquals("", literal.getStringValue());
50+
Assertions.assertNull(VariableMgr.getVarContext(name));
51+
}
52+
Assertions.assertFalse(VariableMgr.toMap(variables).containsKey("skip_checking_acid_version_file"));
53+
}
54+
}

0 commit comments

Comments
 (0)