Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import org.apache.doris.persist.CreateTableInfo;
import org.apache.doris.persist.EditLog;
import org.apache.doris.qe.ConnectContext;
import org.apache.doris.system.SystemInfoService;

import com.google.common.collect.Lists;

Expand Down Expand Up @@ -138,10 +139,10 @@ Database getDbOrAnalysisException(String dbName) {
}
};

new MockUp<Analyzer>() {
@Mock
String getClusterName() {
return "testCluster";
new Expectations() {
{
connectContext.getClusterName();
result = SystemInfoService.DEFAULT_CLUSTER;
}
};
}
Expand Down Expand Up @@ -175,7 +176,7 @@ public void testNormal() throws Exception {
catalog1.alterView(alterViewStmt);

View newView = (View) db.getTableOrAnalysisException("testView");
Assert.assertEquals("WITH testTbl_cte(w1, w2) AS (SELECT `col1` AS `col1`, `col2` AS `col2` FROM `testCluster:testDb`.`testTbl`)" +
Assert.assertEquals("WITH testTbl_cte(w1, w2) AS (SELECT `col1` AS `col1`, `col2` AS `col2` FROM `default_cluster:testDb`.`testTbl`)" +
" SELECT `w1` AS `h1`, sum(`w2`) AS `h2` FROM `testTbl_cte` WHERE `w1` > 10 GROUP BY `w1` ORDER BY `w1`",
newView.getInlineViewDef());
}
Expand Down