This is an automated email from the ASF dual-hosted git repository. xxyu pushed a commit to branch kylin5 in repository https://gitbox.apache.org/repos/asf/kylin.git
commit 4dc173fda7a135830890eb3ffa9bd997fb5bcf03 Author: Jiawei Li <1019037...@qq.com> AuthorDate: Fri Mar 24 17:06:09 2023 +0800 KYLIN-5584 Fixed sonar failures --- .../src/test/java/org/apache/kylin/event/SchemaChangeTest.java | 8 ++++---- .../apache/kylin/rest/controller/NBuildAndQueryMetricsTest.java | 8 ++++---- .../src/main/java/org/apache/kylin/rest/service/QueryService.java | 4 ++-- .../test/java/org/apache/kylin/rest/service/QueryServiceTest.java | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/kylin-it/src/test/java/org/apache/kylin/event/SchemaChangeTest.java b/src/kylin-it/src/test/java/org/apache/kylin/event/SchemaChangeTest.java index e63e699f8b..729b5ee6be 100644 --- a/src/kylin-it/src/test/java/org/apache/kylin/event/SchemaChangeTest.java +++ b/src/kylin-it/src/test/java/org/apache/kylin/event/SchemaChangeTest.java @@ -231,21 +231,21 @@ public class SchemaChangeTest extends AbstractMVCIntegrationTestCase { } @Test - public void testAddColumn() throws Throwable { + public void testAddColumn() throws Exception { addColumn(TABLE_IDENTITY, new ColumnDesc("", "tmp1", "bigint", "", "", "", null)); tableService.reloadTable(getProject(), TABLE_IDENTITY, false, -1, true); assertSqls(); } @Test - public void testRemoveColumn() throws Throwable { + public void testRemoveColumn() throws Exception { removeColumn(TABLE_IDENTITY, "SRC_ID"); tableService.reloadTable(getProject(), TABLE_IDENTITY, false, -1, true); assertSqls(); } @Test - public void testChangeColumnType() throws Throwable { + public void testChangeColumnType() throws Exception { changeColumns(TABLE_IDENTITY, Sets.newHashSet("SRC_ID"), columnDesc -> columnDesc.setDatatype("string")); tableService.reloadTable(getProject(), TABLE_IDENTITY, false, -1, true); assertSqls(); @@ -265,7 +265,7 @@ public class SchemaChangeTest extends AbstractMVCIntegrationTestCase { Assert.assertEquals(0, pair.getSecond().size()); } - private void assertSqls() throws Throwable { + private void assertSqls() throws Exception { for (Pair<String, Boolean> pair : Arrays.asList(Pair.newPair(SQL_LOOKUP, false), Pair.newPair(SQL_DERIVED, false), Pair.newPair(SQL_LOOKUP2, true), Pair.newPair(SQL_DERIVED2, true))) { val req = new SQLRequest(); diff --git a/src/kylin-it/src/test/java/org/apache/kylin/rest/controller/NBuildAndQueryMetricsTest.java b/src/kylin-it/src/test/java/org/apache/kylin/rest/controller/NBuildAndQueryMetricsTest.java index 6f60df0793..7ff9b40cf9 100644 --- a/src/kylin-it/src/test/java/org/apache/kylin/rest/controller/NBuildAndQueryMetricsTest.java +++ b/src/kylin-it/src/test/java/org/apache/kylin/rest/controller/NBuildAndQueryMetricsTest.java @@ -249,20 +249,20 @@ public class NBuildAndQueryMetricsTest extends AbstractMVCIntegrationTestCase { } @Test - public void testMetricsScanForPushDown() throws Throwable { + public void testMetricsScanForPushDown() throws Exception { String sql = "select account_id from test_account limit 30"; assertMetric(sql, 30); } @Test - public void testMetricsScanForTableIndex() throws Throwable { + public void testMetricsScanForTableIndex() throws Exception { String sql = "select count(distinct case when trans_id > 100 then order_id else 0 end)," + "sum(case when trans_id > 100 then price else 0 end), price from test_kylin_fact group by price limit 20"; assertMetric(sql, 10000); } @Test - public void testMetricsScanForTableIndex2() throws Throwable { + public void testMetricsScanForTableIndex2() throws Exception { String sql = "select trans_id from test_kylin_fact limit 20"; assertMetric(sql, 4096); } @@ -273,7 +273,7 @@ public class NBuildAndQueryMetricsTest extends AbstractMVCIntegrationTestCase { assertMetric(sql, 10000); } - private void assertMetric(String sql, long scanRowsExpect) throws Throwable { + private void assertMetric(String sql, long scanRowsExpect) throws Exception { val req = new SQLRequest(); req.setSql(sql); req.setProject(getProject()); diff --git a/src/query-service/src/main/java/org/apache/kylin/rest/service/QueryService.java b/src/query-service/src/main/java/org/apache/kylin/rest/service/QueryService.java index 554a366163..d55ca6dcc5 100644 --- a/src/query-service/src/main/java/org/apache/kylin/rest/service/QueryService.java +++ b/src/query-service/src/main/java/org/apache/kylin/rest/service/QueryService.java @@ -262,7 +262,7 @@ public class QueryService extends BasicService implements CacheSignatureQuerySup } } - public SQLResponse query(SQLRequest sqlRequest) throws Throwable { + public SQLResponse query(SQLRequest sqlRequest) throws Exception { try { slowQueryDetector.queryStart(sqlRequest.getStopId()); markHighPriorityQueryIfNeeded(); @@ -310,7 +310,7 @@ public class QueryService extends BasicService implements CacheSignatureQuerySup slowQueryDetector.addJobIdForAsyncQueryJob(asyncQueryJob.getId()); ExecuteResult result = asyncQueryJob.submit(queryParams); if (!result.succeed()) { - throw result.getThrowable(); + throw (Exception) result.getThrowable(); } return buildSqlResponse(false, Collections.emptyList(), 0, Lists.newArrayList(), diff --git a/src/query-service/src/test/java/org/apache/kylin/rest/service/QueryServiceTest.java b/src/query-service/src/test/java/org/apache/kylin/rest/service/QueryServiceTest.java index d92d04b9c2..ac71197e39 100644 --- a/src/query-service/src/test/java/org/apache/kylin/rest/service/QueryServiceTest.java +++ b/src/query-service/src/test/java/org/apache/kylin/rest/service/QueryServiceTest.java @@ -682,7 +682,7 @@ public class QueryServiceTest extends NLocalFileMetadataTestCase { } @Test - public void testQueryWithTimeOutException() throws Throwable { + public void testQueryWithTimeOutException() throws Exception { final String sql = "select * from exception_table"; final String project = "newten"; @@ -2004,7 +2004,7 @@ public class QueryServiceTest extends NLocalFileMetadataTestCase { } @Test - public void testTableauIntercept() throws Throwable { + public void testTableauIntercept() throws Exception { List<String> sqlList = Files.walk(Paths.get("./src/test/resources/query/tableau_probing")) .filter(file -> Files.isRegularFile(file)).map(path -> { try {