diff --git a/openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/CollectionDAO.java b/openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/CollectionDAO.java index 88772268aa7f..0b83fcbd04c2 100644 --- a/openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/CollectionDAO.java +++ b/openmetadata-service/src/main/java/org/openmetadata/service/jdbi3/CollectionDAO.java @@ -1363,7 +1363,7 @@ int listCountThreadsByEntityLink( + " SELECT te.entityLink, te.type, te.taskStatus, te.id " + " FROM thread_entity te " + " WHERE te.entityId = :entityId " - + ") AS combined " + + ") AS combined WHERE combined.type IS NOT NULL " + "GROUP BY type, taskStatus, entityLink") @RegisterRowMapper(ThreadCountFieldMapper.class) List> listCountByEntityLink( @@ -1639,7 +1639,7 @@ default List> listCountThreadsByGlossaryAndTerms( + " AND (:toType2 IS NULL OR fr.toType LIKE CONCAT(:toType2, '.%') OR fr.toType = :toType2) " + " AND fr.relation = 3 " + " ) " - + ") AS combined_results " + + ") AS combined_results WHERE combined_results.type is not NULL " + "GROUP BY entityLink, type, taskStatus ") @RegisterRowMapper(ThreadCountFieldMapper.class) List> listCountThreadsByGlossaryAndTerms(