From 0a32f07a432546b966c40d3e72a40daf1820ae67 Mon Sep 17 00:00:00 2001 From: hubiao Date: Wed, 29 May 2024 10:03:58 +0800 Subject: [PATCH] fix checkstyle --- .../catalog/DropMaterializedViewTest.java | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/fe/fe-core/src/test/java/org/apache/doris/catalog/DropMaterializedViewTest.java b/fe/fe-core/src/test/java/org/apache/doris/catalog/DropMaterializedViewTest.java index d8a4724d2592404..5742a18267fa1c6 100644 --- a/fe/fe-core/src/test/java/org/apache/doris/catalog/DropMaterializedViewTest.java +++ b/fe/fe-core/src/test/java/org/apache/doris/catalog/DropMaterializedViewTest.java @@ -58,10 +58,10 @@ public static void beforeClass() throws Exception { String createDbStmtStr = String.format("CREATE DATABASE %s;", UnitTestUtil.DB_NAME); String createTableStr1 = String.format("CREATE TABLE %s.%s(k1 int, k2 bigint) DUPLICATE KEY(k1) DISTRIBUTED BY " - + "HASH(k2) BUCKETS 1 PROPERTIES('replication_num' = '1');", UnitTestUtil.DB_NAME, UnitTestUtil.TABLE_NAME); - String createMVStr1 = String.format("CREATE MATERIALIZED VIEW %s.%s BUILD IMMEDIATE REFRESH AUTO ON MANUAL DISTRIBUTED BY RANDOM BUCKETS 1\n" + - " PROPERTIES ('replication_num' = '1') AS SELECT k1, sum(k2) as k3 from %s.%s " - + "group by k1;", UnitTestUtil.DB_NAME, UnitTestUtil.MV_NAME, UnitTestUtil.DB_NAME, UnitTestUtil.TABLE_NAME); + + "HASH(k2) BUCKETS 1 PROPERTIES('replication_num' = '1');", UnitTestUtil.DB_NAME, UnitTestUtil.TABLE_NAME); + String createMVStr1 = String.format("CREATE MATERIALIZED VIEW %s.%s BUILD IMMEDIATE REFRESH AUTO ON MANUAL " + + "DISTRIBUTED BY RANDOM BUCKETS 1 PROPERTIES ('replication_num' = '1') AS SELECT k1, sum(k2) as k3 from %s.%s" + + "group by k1;", UnitTestUtil.DB_NAME, UnitTestUtil.MV_NAME, UnitTestUtil.DB_NAME, UnitTestUtil.TABLE_NAME); createDb(createDbStmtStr); createTable(createTableStr1); createMvByNereids(createMVStr1); @@ -109,7 +109,7 @@ private static void createTable(String sql) throws Exception { private static void dropTable(String db, String tbl, boolean isMaterializedView) throws Exception { DropTableStmt dropTableStmt = new DropTableStmt(false, - new TableName(InternalCatalog.INTERNAL_CATALOG_NAME, db, tbl), false, false); + new TableName(InternalCatalog.INTERNAL_CATALOG_NAME, db, tbl), false, false); if (isMaterializedView) { dropTableStmt.setMaterializedView(true); } @@ -122,7 +122,7 @@ private static void checkAlterJob() throws InterruptedException { for (AlterJobV2 alterJobV2 : alterJobs.values()) { while (!alterJobV2.getJobState().isFinalState()) { System.out.println("alter job " + alterJobV2.getDbId() - + " is running. state: " + alterJobV2.getJobState()); + + " is running. state: " + alterJobV2.getJobState()); Thread.sleep(100); } System.out.println("alter job " + alterJobV2.getDbId() + " is done. state: " + alterJobV2.getJobState()); @@ -133,8 +133,7 @@ private static void checkAlterJob() throws InterruptedException { // there is still a short gap between "job finish" and "table become normal", // so if user send next alter job right after the "job finish", // it may encounter "table's state not NORMAL" error. - Database db = - Env.getCurrentInternalCatalog().getDbOrMetaException(alterJobV2.getDbId()); + Database db = Env.getCurrentInternalCatalog().getDbOrMetaException(alterJobV2.getDbId()); OlapTable tbl = (OlapTable) db.getTableOrMetaException(alterJobV2.getTableId(), Table.TableType.OLAP); while (tbl.getState() != OlapTable.OlapTableState.NORMAL) { Thread.sleep(1000); @@ -150,10 +149,10 @@ private static void checkAlterJob() throws InterruptedException { @Test public void testDropMv() throws Exception { ExceptionChecker.expectThrowsWithMsg(DdlException.class, - String.format("'%s.%s' is not TABLE. Use 'DROP MATERIALIZED VIEW %s.%s'", - UnitTestUtil.DB_NAME, UnitTestUtil.MV_NAME, UnitTestUtil.DB_NAME, UnitTestUtil.MV_NAME), - () -> dropTable(UnitTestUtil.DB_NAME, UnitTestUtil.MV_NAME, false)); + String.format("'%s.%s' is not TABLE. Use 'DROP MATERIALIZED VIEW %s.%s'", + UnitTestUtil.DB_NAME, UnitTestUtil.MV_NAME, UnitTestUtil.DB_NAME, UnitTestUtil.MV_NAME), + () -> dropTable(UnitTestUtil.DB_NAME, UnitTestUtil.MV_NAME, false)); ExceptionChecker.expectThrowsNoException(() -> dropMvByNereids(String.format("DROP MATERIALIZED VIEW %s.%s", - UnitTestUtil.DB_NAME, UnitTestUtil.MV_NAME))); + UnitTestUtil.DB_NAME, UnitTestUtil.MV_NAME))); } }