You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CDM cache warming still fails when cache.achilles.usePersonCount=false (missing cc alias in getBatchConceptRecordCount.sql) #2561
With cache.achilles.usePersonCount=false, warming the CDM results cache (GET /cdmresults/{sourceKey}/warmCache, the startup/cron warming job) loads record counts from achilles_result_concept_count into cdm_cache, the same way it does with usePersonCount=true.
Actual behavior
The placeholder fix for #2517 (a9720e7) is in, but the batch query still cannot run. getBatchConceptRecordCount.sql uses cc.concept_id in the select list, join and WHERE clause, but never declares the cc alias:
selectcc.concept_id, record_count, descendant_record_count
from @resultTableQualifier.achilles_result_concept_countjoin @vocabularyTableQualifier.concept c oncc.concept_id=c.concept_idWHEREcc.concept_id>= @conceptIdentifierMin andcc.concept_id<= @conceptIdentifierMax
The person-count variant (getBatchConceptRecordPersonCount.sql) declares the alias, so only usePersonCount=false is affected. On PostgreSQL the warm job logs:
ERROR: missing FROM-clause entry for table "cc" at character 153
ERROR o.o.w.cdmresults.service.CDMCacheService - Failed to warm cache ... Exception: PreparedStatementCallback; bad SQL grammar [select cc.concept_id, record_count, descendant_record_count ...
SQL Server reports The multi-part identifier "cc.concept_id" could not be bound. The error is caught and logged in CDMCacheService.warm, so nothing gets cached and no error reaches the user.
There is a second problem on the same path. CDMCacheBatchService.save decides whether a cached concept changed by unboxing all four counts into a long[]. With usePersonCount=false the person counts are null, so re-warming any concept that is already in cdm_cache throws NullPointerException: Cannot invoke "java.lang.Long.longValue()" because the return value of "...CDMCacheEntity.getPersonCount()" is null.
Activity