This is an automated email from the ASF dual-hosted git repository.
yasithdev pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/airavata.git
The following commit(s) were added to refs/heads/master by this push:
new 0a0473010b fix(research): ignore blank experiment-statistics filters
(#684)
0a0473010b is described below
commit 0a0473010bf58e1f58489167ac985ae8d73b0eea
Author: Yasith Jayawardana <[email protected]>
AuthorDate: Sat Jun 13 22:24:38 2026 -0400
fix(research): ignore blank experiment-statistics filters (#684)
The statistics gRPC handler forwards the proto userName, applicationName and
resourceHostName fields verbatim, and unset proto strings default to ""
rather
than null. filterExperimentStatisticsQuery only skipped null values, so an
unset
field became a literal ES.userName = '' (etc.) predicate that matched no
rows —
the admin experiment-statistics page, which sends none of these, always
returned
zero. Guard each optional string filter against blank.
---
.../airavata/research/repository/ExperimentSummaryRepository.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git
a/airavata-api/research-service/src/main/java/org/apache/airavata/research/repository/ExperimentSummaryRepository.java
b/airavata-api/research-service/src/main/java/org/apache/airavata/research/repository/ExperimentSummaryRepository.java
index 5db59fa8cb..4459554b53 100644
---
a/airavata-api/research-service/src/main/java/org/apache/airavata/research/repository/ExperimentSummaryRepository.java
+++
b/airavata-api/research-service/src/main/java/org/apache/airavata/research/repository/ExperimentSummaryRepository.java
@@ -487,13 +487,13 @@ public class ExperimentSummaryRepository
}
}
- if (userName != null) {
+ if (userName != null && !userName.isEmpty()) {
logger.debug("Filter Experiments by UserName");
queryParameters.put(DBConstants.Experiment.USER_NAME, userName);
query += "ES.userName = :" + DBConstants.Experiment.USER_NAME + "
AND ";
}
- if (applicationName != null) {
+ if (applicationName != null && !applicationName.isEmpty()) {
logger.debug("Filter Experiments by ApplicationName");
queryParameters.put(DBConstants.Experiment.EXECUTION_ID,
applicationName);
query += "ES.executionId = :" +
DBConstants.Experiment.EXECUTION_ID + " AND ";
@@ -509,7 +509,7 @@ public class ExperimentSummaryRepository
}
}
- if (resourceHostName != null) {
+ if (resourceHostName != null && !resourceHostName.isEmpty()) {
logger.debug("Filter Experiments by ResourceHostName");
queryParameters.put(DBConstants.Experiment.RESOURCE_HOST_ID,
resourceHostName);
query += "ES.resourceHostId = :" +
DBConstants.Experiment.RESOURCE_HOST_ID + " ";