Skip to content

Commit

Permalink
[refactor](config) Delete the environment variable enable_vectorized_…
Browse files Browse the repository at this point in the history
…engine (#18166)
  • Loading branch information
Mryange authored Apr 7, 2023
1 parent 308ff9a commit 926c605
Show file tree
Hide file tree
Showing 110 changed files with 64 additions and 265 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,6 @@ public boolean checkEnableTwoPhaseRead(Analyzer analyzer) {
// only vectorized mode and session opt variable enabled
if (ConnectContext.get() == null
|| ConnectContext.get().getSessionVariable() == null
|| !ConnectContext.get().getSessionVariable().enableVectorizedEngine
|| !ConnectContext.get().getSessionVariable().enableTwoPhaseReadOpt) {
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ private static SelectStmt rewriteSelectStatement(SelectStmt stmt, Analyzer analy
if (result.hasWhereClause()) {
// Push negation to leaf operands.
result.whereClause = Expr.pushNegationToOperands(result.whereClause);
if (ConnectContext.get() == null || !ConnectContext.get().getSessionVariable().enableVectorizedEngine()) {
if (ConnectContext.get() == null) {
// Check if we can equal the subqueries in the WHERE clause. OR predicates with
// subqueries are not supported.
if (hasSubqueryInDisjunction(result.whereClause)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public static boolean isVectorized() {
if (connectContext == null) {
return false;
}
return connectContext.getSessionVariable().enableVectorizedEngine();
return true;
}

public static boolean isPipeline() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ public TExecPlanFragmentParams plan(TUniqueId loadId) throws UserException {
queryOptions.setMemLimit(taskInfo.getMemLimit());
// for stream load, we use exec_mem_limit to limit the memory usage of load channel.
queryOptions.setLoadMemLimit(taskInfo.getMemLimit());
//load
queryOptions.setEnableVectorizedEngine(Config.enable_vectorized_load);
queryOptions.setEnablePipelineEngine(Config.enable_pipeline_load);
queryOptions.setBeExecVersion(Config.be_exec_version);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,6 @@ private void setFromUserProperty(ConnectContext connectContext) {

private void initQueryOptions(ConnectContext context) {
this.queryOptions = context.getSessionVariable().toThrift();
this.queryOptions.setEnableVectorizedEngine(VectorizedUtil.isVectorized());
this.queryOptions.setEnablePipelineEngine(VectorizedUtil.isPipeline());
this.queryOptions.setBeExecVersion(Config.be_exec_version);
this.queryOptions.setExecutionTimeout(context.getExecTimeout());
Expand All @@ -416,9 +415,7 @@ public void setQueryType(TQueryType type) {
this.queryOptions.setQueryType(type);
}

public void setExecVecEngine(boolean vec) {
this.queryOptions.setEnableVectorizedEngine(vec);
}
public void setExecVecEngine(boolean vec) {}

public void setExecPipEngine(boolean vec) {
this.queryOptions.setEnablePipelineEngine(vec);
Expand Down
12 changes: 0 additions & 12 deletions fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.java
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,6 @@ public class SessionVariable implements Serializable, Writable {
// If user set a very small value, use this value instead.
public static final long MIN_INSERT_VISIBLE_TIMEOUT_MS = 1000;

public static final String ENABLE_VECTORIZED_ENGINE = "enable_vectorized_engine";

public static final String ENABLE_PIPELINE_ENGINE = "enable_pipeline_engine";
public static final String ENABLE_RPC_OPT_FOR_PIPELINE = "enable_rpc_opt_for_pipeline";

Expand Down Expand Up @@ -524,8 +522,6 @@ public class SessionVariable implements Serializable, Writable {
@VariableMgr.VarAttr(name = EXTRACT_WIDE_RANGE_EXPR, needForward = true)
public boolean extractWideRangeExpr = true;

@VariableMgr.VarAttr(name = ENABLE_VECTORIZED_ENGINE)
public boolean enableVectorizedEngine = true;

@VariableMgr.VarAttr(name = ENABLE_PIPELINE_ENGINE, fuzzy = true)
public boolean enablePipelineEngine = false;
Expand Down Expand Up @@ -1337,14 +1333,6 @@ public void setRuntimeFilterMaxInNum(int runtimeFilterMaxInNum) {
this.runtimeFilterMaxInNum = runtimeFilterMaxInNum;
}

public boolean enableVectorizedEngine() {
return enableVectorizedEngine;
}

public void setEnableVectorizedEngine(boolean enableVectorizedEngine) {
this.enableVectorizedEngine = enableVectorizedEngine;
}

public boolean enablePipelineEngine() {
return enablePipelineEngine;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,16 +247,6 @@ public void testCollectExprs() throws Exception {
// But when enable vec engine and for now, it will throw VecNotImplException
// with msg: "could not be changed to nullable".
// So here we make a "if else" check, and once this VecNotImplException is fixed, we should remove this check.
SessionVariable sv = new SessionVariable();
if (!sv.enableVectorizedEngine) {
stmt = (QueryStmt) UtFrameUtils.parseAndAnalyzeStmt(sql, ctx);
exprsMap.clear();
stmt.collectExprs(exprsMap);
Assert.assertEquals(24, exprsMap.size());
constMap.clear();
constMap = getConstantExprMap(exprsMap, analyzer);
Assert.assertEquals(4, constMap.size());
}
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,10 @@ protected void runBeforeAll() throws Exception {
public void testTurnoffVectorizedEngineWhenCannotChangeSlotToNullable() throws Exception {
String sql = "explain select * from test.tbl1 t1"
+ " where (select count(*) from test.tbl1 t2 where t1.k1 = t2.k1) > 0";
connectContext.getSessionVariable().enableVectorizedEngine = true;
StmtExecutor stmtExecutor = new StmtExecutor(connectContext, sql);
connectContext.setExecutor(stmtExecutor);
stmtExecutor.execute();
connectContext.setExecutor(null);
Assertions.assertEquals(MysqlStateType.EOF, connectContext.getState().getStateType());
Assertions.assertTrue(connectContext.getSessionVariable().enableVectorizedEngine());
}
}
4 changes: 2 additions & 2 deletions gensrc/thrift/PaloInternalService.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ struct TQueryOptions {
// if the right table is greater than this value in the hash join, we will ignore IN filter
34: optional i32 runtime_filter_max_in_num = 1024;

// whether enable vectorized engine
41: optional bool enable_vectorized_engine = false
// whether enable vectorized engine
41: optional bool enable_vectorized_engine = true

// the resource limitation of this query
42: optional TResourceLimit resource_limit
Expand Down
15 changes: 6 additions & 9 deletions regression-test/data/dynamic_table_p0/sql/q05.out
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,27 @@
0

-- !q05_2 --
0

-- !q05_3 --
30417

-- !q05_4 --
-- !q05_3 --
getguesstimate/guesstimate-app 26
ericelliott/essential-javascript-links 16
FreeCodeCamp/FreeCodeCamp 14
tj/frontend-boilerplate 14
prakhar1989/awesome-courses 12

-- !q05_5 --
-- !q05_4 --
3487211075

-- !q05_6 --
-- !q05_5 --
94350289813772

-- !q05_7 --
-- !q05_6 --
518892546

-- !q05_8 --
-- !q05_7 --
0

-- !q05_9 --
-- !q05_8 --
56947

10 changes: 4 additions & 6 deletions regression-test/data/mysql_fulltext/sql/large_records_q01.out
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
-- This file is automatically generated. You should know what you did if you want to edit this

-- !large_records_q01 --
0
49

-- !large_records_q01_2 --
49
35

-- !large_records_q01_3 --
35
1

-- !large_records_q01_4 --
1
Expand All @@ -27,8 +28,5 @@
1

-- !large_records_q01_10 --
1

-- !large_records_q01_11 --
row5col1word1 row5col1word2 row5col1word3 row5col1word4 row5col1word5 row5col1word6 row5col1word7 row5col1word8 row5col1word9 row5col1word10 row5col1word11 row5col1word12 row5col1word13 row5col1word14 row5col1word15 row5col1word16 row5col1word17 row5col1word18 row5col1word19 row5col1word20 row5col1word21 row5col1word22 row5col1word23 row5col1word24 row5col1word25 row5col1word26 row5col1word27 row5col1word28 row5col1word29 row5col1word30 row5col1word31 row5col1word32 row5col1word33 row5col1word34 row5col1word35 row5col1word36 row5col1word37 row5col1word38 row5col1word39 row5col1word40 row5col1word41 row5col1word42 row5col1word43 row5col1word44 row5col1word45 row5col1word46 row5col1word47 row5col1word48 row5col1word49 row5col1word50 row5col2word1 row5col2word2 row5col2word3 row5col2word4 row5col2word5 row5col2word6 row5col2word7 row5col2word8 row5col2word9 row5col2word10 row5col2word11 row5col2word12 row5col2word13 row5col2word14 row5col2word15 row5col2word16 row5col2word17 row5col2word18 row5col2word19 row5col2word20 row5col2word21 row5col2word22 row5col2word23 row5col2word24 row5col2word25 row5col2word26 row5col2word27 row5col2word28 row5col2word29 row5col2word30 row5col2word31 row5col2word32 row5col2word33 row5col2word34 row5col2word35 row5col2word36 row5col2word37 row5col2word38 row5col2word39 row5col2word40 row5col2word41 row5col2word42 row5col2word43 row5col2word44 row5col2word45 row5col2word46 row5col2word47 row5col2word48 row5col2word49 row5col2word50

9 changes: 3 additions & 6 deletions regression-test/data/mysql_fulltext/sql/large_records_q02.out
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
-- This file is automatically generated. You should know what you did if you want to edit this
-- !large_records_q02 --
0
49

-- !large_records_q02_2 --
49
35

-- !large_records_q02_3 --
35
1

-- !large_records_q02_4 --
1
Expand All @@ -27,8 +27,5 @@
1

-- !large_records_q02_10 --
1

-- !large_records_q02_11 --
row5col1word1 row5col1word2 row5col1word3 row5col1word4 row5col1word5 row5col1word6 row5col1word7 row5col1word8 row5col1word9 row5col1word10 row5col1word11 row5col1word12 row5col1word13 row5col1word14 row5col1word15 row5col1word16 row5col1word17 row5col1word18 row5col1word19 row5col1word20 row5col1word21 row5col1word22 row5col1word23 row5col1word24 row5col1word25 row5col1word26 row5col1word27 row5col1word28 row5col1word29 row5col1word30 row5col1word31 row5col1word32 row5col1word33 row5col1word34 row5col1word35 row5col1word36 row5col1word37 row5col1word38 row5col1word39 row5col1word40 row5col1word41 row5col1word42 row5col1word43 row5col1word44 row5col1word45 row5col1word46 row5col1word47 row5col1word48 row5col1word49 row5col1word50 row5col2word1 row5col2word2 row5col2word3 row5col2word4 row5col2word5 row5col2word6 row5col2word7 row5col2word8 row5col2word9 row5col2word10 row5col2word11 row5col2word12 row5col2word13 row5col2word14 row5col2word15 row5col2word16 row5col2word17 row5col2word18 row5col2word19 row5col2word20 row5col2word21 row5col2word22 row5col2word23 row5col2word24 row5col2word25 row5col2word26 row5col2word27 row5col2word28 row5col2word29 row5col2word30 row5col2word31 row5col2word32 row5col2word33 row5col2word34 row5col2word35 row5col2word36 row5col2word37 row5col2word38 row5col2word39 row5col2word40 row5col2word41 row5col2word42 row5col2word43 row5col2word44 row5col2word45 row5col2word46 row5col2word47 row5col2word48 row5col2word49 row5col2word50

10 changes: 4 additions & 6 deletions regression-test/data/mysql_fulltext/sql/large_records_q03.out
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
-- This file is automatically generated. You should know what you did if you want to edit this

-- !large_records_q03 --
0
100

-- !large_records_q03_2 --
100

-- !large_records_q03_3 --
35

-- !large_records_q03_4 --
35
1

-- !large_records_q03_5 --
1
Expand All @@ -25,6 +26,3 @@
-- !large_records_q03_9 --
1

-- !large_records_q03_10 --
1

10 changes: 4 additions & 6 deletions regression-test/data/mysql_fulltext/sql/large_records_q04.out
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
-- This file is automatically generated. You should know what you did if you want to edit this

-- !large_records_q04 --
0
100

-- !large_records_q04_2 --
100

-- !large_records_q04_3 --
35

-- !large_records_q04_4 --
35
1

-- !large_records_q04_5 --
1
Expand All @@ -25,6 +26,3 @@
-- !large_records_q04_9 --
1

-- !large_records_q04_10 --
1

10 changes: 4 additions & 6 deletions regression-test/data/mysql_fulltext/sql/large_records_q05.out
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
-- This file is automatically generated. You should know what you did if you want to edit this

-- !large_records_q05 --
0
100

-- !large_records_q05_2 --
100
0

-- !large_records_q05_3 --
0
100

-- !large_records_q05_4 --
100
Expand All @@ -15,8 +16,5 @@
100

-- !large_records_q05_6 --
100

-- !large_records_q05_7 --
0

11 changes: 5 additions & 6 deletions regression-test/data/mysql_fulltext/sql/large_records_q06.out
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
-- This file is automatically generated. You should know what you did if you want to edit this


-- !large_records_q06 --
0
100

-- !large_records_q06_2 --
100
0

-- !large_records_q06_3 --
0
100

-- !large_records_q06_4 --
100
Expand All @@ -15,8 +17,5 @@
100

-- !large_records_q06_6 --
100

-- !large_records_q06_7 --
0

9 changes: 4 additions & 5 deletions regression-test/data/mysql_fulltext/sql/large_records_q07.out
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
-- This file is automatically generated. You should know what you did if you want to edit this


-- !large_records_q07 --
0
100

-- !large_records_q07_2 --
100
Expand All @@ -12,11 +14,8 @@
100

-- !large_records_q07_5 --
100

-- !large_records_q07_6 --
0

-- !large_records_q07_7 --
-- !large_records_q07_6 --
0

9 changes: 4 additions & 5 deletions regression-test/data/mysql_fulltext/sql/large_records_q08.out
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
-- This file is automatically generated. You should know what you did if you want to edit this


-- !large_records_q08 --
0
100

-- !large_records_q08_2 --
100
Expand All @@ -12,11 +14,8 @@
100

-- !large_records_q08_5 --
100

-- !large_records_q08_6 --
0

-- !large_records_q08_7 --
-- !large_records_q08_6 --
0

7 changes: 3 additions & 4 deletions regression-test/data/mysql_fulltext/sql/test_join_q01.out
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
-- This file is automatically generated. You should know what you did if you want to edit this
-- !test_join_q01 --
0

-- !test_join_q01_2 --

-- !test_join_q01 --
1 a1 2003-05-23T19:30 1 aberdeen town hall

-- !test_join_q01_3 --
-- !test_join_q01_2 --
1 a1 2003-05-23T19:30 1 aberdeen town hall

7 changes: 3 additions & 4 deletions regression-test/data/mysql_fulltext/sql/test_join_q02.out
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
-- This file is automatically generated. You should know what you did if you want to edit this
-- !test_join_q02 --
0

-- !test_join_q02_2 --

-- !test_join_q02 --
1 a1 2003-05-23T19:30 1 aberdeen town hall

-- !test_join_q02_3 --
-- !test_join_q02_2 --
1 a1 2003-05-23T19:30 1 aberdeen town hall

Loading

0 comments on commit 926c605

Please sign in to comment.