This is an automated email from the ASF dual-hosted git repository.
morningman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-doris.git
The following commit(s) were added to refs/heads/master by this push:
new bd72328 [UT] Fix FE ut bugs (#5387)
bd72328 is described below
commit bd7232817774debd7c70f84e44c841f7bbf76122
Author: xxiao2018 <[email protected]>
AuthorDate: Sun Feb 14 15:59:21 2021 +0800
[UT] Fix FE ut bugs (#5387)
This bug is introduced from #5356
---
.../java/org/apache/doris/planner/QueryPlanTest.java | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git
a/fe/fe-core/src/test/java/org/apache/doris/planner/QueryPlanTest.java
b/fe/fe-core/src/test/java/org/apache/doris/planner/QueryPlanTest.java
index f66c9be..e1bc9d3 100644
--- a/fe/fe-core/src/test/java/org/apache/doris/planner/QueryPlanTest.java
+++ b/fe/fe-core/src/test/java/org/apache/doris/planner/QueryPlanTest.java
@@ -36,7 +36,6 @@ import org.apache.doris.catalog.Partition;
import org.apache.doris.catalog.Replica;
import org.apache.doris.catalog.Tablet;
import org.apache.doris.catalog.Type;
-import org.apache.doris.common.Config;
import org.apache.doris.common.FeConstants;
import org.apache.doris.common.jmockit.Deencapsulation;
import org.apache.doris.load.EtlJobType;
@@ -44,14 +43,14 @@ import org.apache.doris.qe.ConnectContext;
import org.apache.doris.qe.QueryState.MysqlStateType;
import org.apache.doris.utframe.UtFrameUtils;
-import com.google.common.collect.Lists;
-
import org.apache.commons.lang3.StringUtils;
import org.junit.AfterClass;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
+import com.google.common.collect.Lists;
+
import java.io.File;
import java.util.List;
import java.util.UUID;
@@ -915,23 +914,24 @@ public class QueryPlanTest {
// 2.3 test can not convert to constant,middle when expr is not
constant
String sql23 = "select case 'a' when 'b' then 'a' when substr(k7,2,1)
then 2 when false then 3 else 0 end as col23 from test.baseall";
-
Assert.assertTrue(StringUtils.containsIgnoreCase(UtFrameUtils.getSQLPlanOrErrorMsg(connectContext,
"explain " + sql23),
- "OUTPUT EXPRS:CASE'a' WHEN substr(`k7`, 2, 1) THEN '2' WHEN
'0' THEN '3' ELSE '0' END"));
+ String a = UtFrameUtils.getSQLPlanOrErrorMsg(connectContext, "explain
" + sql23);
+ Assert.assertTrue(StringUtils.containsIgnoreCase(a,
+ "OUTPUT EXPRS:CASE 'a' WHEN substr(`k7`, 2, 1) THEN '2' WHEN
'0' THEN '3' ELSE '0' END"));
// 2.3.1 first when expr is not constant
String sql231 = "select case 'a' when substr(k7,2,1) then 2 when 1
then 'a' when false then 3 else 0 end as col231 from test.baseall";
Assert.assertTrue(StringUtils.containsIgnoreCase(UtFrameUtils.getSQLPlanOrErrorMsg(connectContext,
"explain " + sql231),
- "OUTPUT EXPRS:CASE'a' WHEN substr(`k7`, 2, 1) THEN '2' WHEN
'1' THEN 'a' WHEN '0' THEN '3' ELSE '0' END"));
+ "OUTPUT EXPRS:CASE 'a' WHEN substr(`k7`, 2, 1) THEN '2' WHEN
'1' THEN 'a' WHEN '0' THEN '3' ELSE '0' END"));
// 2.3.2 case expr is not constant
String sql232 = "select case k1 when substr(k7,2,1) then 2 when 1 then
'a' when false then 3 else 0 end as col232 from test.baseall";
Assert.assertTrue(StringUtils.containsIgnoreCase(UtFrameUtils.getSQLPlanOrErrorMsg(connectContext,
"explain " + sql232),
- "OUTPUT EXPRS:CASE`k1` WHEN substr(`k7`, 2, 1) THEN '2' WHEN
'1' THEN 'a' WHEN '0' THEN '3' ELSE '0' END"));
+ "OUTPUT EXPRS:CASE `k1` WHEN substr(`k7`, 2, 1) THEN '2' WHEN
'1' THEN 'a' WHEN '0' THEN '3' ELSE '0' END"));
// 3.1 test float,float in case expr
String sql31 = "select case cast(100 as float) when 1 then 'a' when 2
then 'b' else 'other' end as col31;";
Assert.assertTrue(StringUtils.containsIgnoreCase(UtFrameUtils.getSQLPlanOrErrorMsg(connectContext,
"explain " + sql31),
- "constant exprs: \n CASE100.0 WHEN 1.0 THEN 'a' WHEN
2.0 THEN 'b' ELSE 'other' END"));
+ "constant exprs: \n CASE 100.0 WHEN 1.0 THEN 'a' WHEN
2.0 THEN 'b' ELSE 'other' END"));
// 4.1 test null in case expr return else
String sql41 = "select case null when 1 then 'a' when 2 then 'b' else
'other' end as col41";
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]