kevinw66 commented on code in PR #63: URL: https://github.com/apache/ambari-metrics/pull/63#discussion_r1022365735
########## ambari-metrics-timelineservice/src/main/java/org/apache/ambari/metrics/core/timeline/query/TransientMetricCondition.java: ########## @@ -60,22 +60,22 @@ public StringBuilder getTransientConditionClause() { appendConjunction = appendHostnameClause(sb, appendConjunction); String appId = getAppId(); - if (appId.contains("%")) { - appendConjunction = append(sb, appendConjunction, getAppId(), " APP_ID LIKE ?"); - } else { - appendConjunction = append(sb, appendConjunction, getAppId(), " APP_ID = ?"); + if (appId != null) { + if (appId.contains("%")) { + appendConjunction = append(sb, appendConjunction, getAppId(), " APP_ID LIKE ?"); + } else { + appendConjunction = append(sb, appendConjunction, getAppId(), " APP_ID = ?"); + } } String instanceId = getInstanceId(); - if (instanceId.contains("%")) { - appendConjunction = append(sb, appendConjunction, getInstanceId(), " INSTANCE_ID LIKE ?"); - } else { - appendConjunction = append(sb, appendConjunction, getInstanceId(), " INSTANCE_ID = ?"); + if (instanceId != null) { + if (instanceId.contains("%")) { + appendConjunction = append(sb, appendConjunction, getInstanceId(), " INSTANCE_ID LIKE ?"); + } else { + appendConjunction = append(sb, appendConjunction, getInstanceId(), " INSTANCE_ID = ?"); + } } - appendConjunction = append(sb, appendConjunction, getStartTime(), " SERVER_TIME >= ?"); - append(sb, appendConjunction, getEndTime(), " SERVER_TIME < ?"); - - return sb; Review Comment: I don't see this being deleted in original commit, why delete here? -- 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. To unsubscribe, e-mail: commits-unsubscr...@ambari.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@ambari.apache.org For additional commands, e-mail: commits-h...@ambari.apache.org