Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

CDM cache warming still fails when cache.achilles.usePersonCount=false (missing `cc` alias in getBatchConceptRecordCount.sql)

オープン 初心者向け
#2,561 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@DG47 がすでに取り組んでいます。

2026年10月19日 から。

  • #2562 @DG47 による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
82/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
java, postgresql, sql
領域
backend, databases

調査の方向性

まず getBatchConceptRecordCount.sql を確認し、そのテーブルエイリアスを getBatchConceptRecordPersonCount.sql のものと比較します。次に CDMCacheBatchService.save を調べ、person count が null の場合の処理を確認します。cache.achilles.usePersonCount=false にして、すでに cdm_cache にある concept を含めてキャッシュをウォームアップし、問題を再現します。ウォームアップ時に SQL エラーや null のアンボクシング失敗を起こさずに record count が読み込まれれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Expected behavior

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 (a9720e7b) 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:

select cc.concept_id, record_count, descendant_record_count
from @resultTableQualifier.achilles_result_concept_count
join @vocabularyTableQualifier.concept c on cc.concept_id = c.concept_id
WHERE cc.concept_id >= @conceptIdentifierMin and cc.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.

Steps to reproduce behavior
  1. Set cache.achilles.usePersonCount=false (for example, for a results schema whose achilles_result_concept_count table has no person count columns, see #2239).
  2. Call GET /WebAPI/cdmresults/{sourceKey}/warmCache (or enable cache warming).
  3. The job logs "Failed to warm cache" with the SQL error above, and cdm_cache stays empty for the source.

Environment: WebAPI master (817bae80) and master-2.15; reproduced against embedded PostgreSQL 15 in the WebAPI test harness, JDK 21.

主要言語
Java
スター
153
フォーク
187
平均マージ
2日 12時間
マージ済み PR(30日)
13

環境構築

  • Dockerfile または Docker Compose ファイルあり
  • プルリクエストのテンプレートなし
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

OHDSI/WebAPI のほかの issue

OHDSI/WebAPI の issue をすべて見る

似ている issue

Java の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。