Identify surveys whose stored aux hash differs from the current aux hash
aux_hash_candidates.RdStage 1 of the two-stage aux-change gate. For each previously-cleaned
survey (present in the master inventory), compares its stored per-survey
aux hash (from the master's aux_<measure>_hash columns) against the
current aux content_hash for each requested measure. A survey is a
candidate when any requested measure's stored hash differs from the
current hash, or when the stored hash is missing (survey cleaned before
this feature — treated as changed).
Value
A data.table of candidate surveys (subset of inv), with an
attribute changed_measures holding the measures whose hash changed.
Returns NULL when no survey is a candidate.
Details
The master inventory is reduced to one row per survey_id for the same
content_hash_dlw. All rows in that group must have identical aux hashes;
a conflict aborts loudly (this protects the invariant that split pip_ids
for one survey/content version use the same aux versions).
The current DLW inventory is joined to the master on both survey_id and
the DLW content hash (inv$content_hash matched to master$content_hash_dlw),
so a survey with multiple historical DLW versions is compared against the
aux hashes of its current version only.
See also
Other pd_process_data pipeline:
add_attr(),
build_pip_inventory(),
create_attr(),
data_to_dt(),
filter_aux_data(),
filter_aux_inv(),
fix_year_var(),
get_aux_hashes(),
inv_dlw_load(),
inv_to_process(),
log_report(),
pd_aux_attr(),
pd_deflation(),
save_pip_data(),
survey_id_to_attr(),
valid_dlw_load()