fix: work around for DI reindexing (#12299)

* fix: work around for DI reindexing

* fix: substring to capitalize
This commit is contained in:
Teddy 2023-07-05 14:17:51 +02:00 committed by GitHub
parent 5e567c1991
commit ba3a1e1ed6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -20,6 +20,7 @@ import java.util.List;
import java.util.Map;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.openmetadata.schema.analytics.ReportData;
import org.openmetadata.schema.system.StepStats;
import org.openmetadata.service.exception.SourceException;
@ -91,11 +92,13 @@ public class PaginatedDataInsightSource implements Source<ResultList<ReportData>
}
public ResultList<ReportData> getReportDataPagination(String entityFQN, int limit, String after) {
int reportDataCount = dao.entityExtensionTimeSeriesDao().listCount(entityFQN);
// workaround. Should be fixed in https://github.com/open-metadata/OpenMetadata/issues/12298
String upperCaseFQN = StringUtils.capitalize(entityFQN);
int reportDataCount = dao.entityExtensionTimeSeriesDao().listCount(EntityUtil.hash(upperCaseFQN));
List<CollectionDAO.ReportDataRow> reportDataList =
dao.entityExtensionTimeSeriesDao()
.getAfterExtension(
EntityUtil.hash(entityFQN), limit + 1, after == null ? "0" : RestUtil.decodeCursor(after));
EntityUtil.hash(upperCaseFQN), limit + 1, after == null ? "0" : RestUtil.decodeCursor(after));
return getAfterExtensionList(reportDataList, after, limit, reportDataCount);
}