You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kylin.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2021/03/11 00:19:00 UTC

[jira] [Commented] (KYLIN-4929) skip metrics update for simple queries to avoid NPE warnings

    [ https://issues.apache.org/jira/browse/KYLIN-4929?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17299200#comment-17299200 ] 

ASF GitHub Bot commented on KYLIN-4929:
---------------------------------------

zzcclp commented on a change in pull request #1605:
URL: https://github.com/apache/kylin/pull/1605#discussion_r591974403



##########
File path: server-base/src/main/java/org/apache/kylin/rest/metrics/QueryMetricsFacade.java
##########
@@ -84,6 +84,9 @@ private static void updateMetricsToLocal(SQLRequest sqlRequest, SQLResponse sqlR
         update(getQueryMetrics(projectName), sqlResponse);
 
         String cube = sqlResponse.getCube();
+        if (cube == null) {

Review comment:
       It's better use `StringUtils.isEmpty(cube)` to check.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> skip metrics update for simple queries to avoid NPE warnings
> ------------------------------------------------------------
>
>                 Key: KYLIN-4929
>                 URL: https://issues.apache.org/jira/browse/KYLIN-4929
>             Project: Kylin
>          Issue Type: Improvement
>          Components: Metrics
>            Reporter: Congling Xia
>            Assignee: Congling Xia
>            Priority: Minor
>             Fix For: v3.1.2
>
>
> Users may use simple queries like 'select 1' to check the availability of kylin service. No realization is needed for such queries. Metric system will raise NullPointerException when trying to get the name of the realization.
> It does not cause the query to fail, but prints a lot of annoying warning logs with stack-traces.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)