carlos@addressforall:/var/gits/_dg/preserv/src$ make load_optim_csv pg_datalake=dl03t_main
Load tables donor.csv, donatedPack.csv and codec_type into postgres://postgres@localhost/dl03t_main, for all jurisdictions.
[Press ENTER to continue or Ctrl+C to quit]
psql postgres://postgres@localhost/dl03t_main -c "SELECT optim.insert_donor_pack(t) FROM unnest(ARRAY['BO','BR','CL','CO','EC','PE','PY','SR','UY','VE']) t;"
ERROR: yaml.scanner.ScannerError: while scanning a block scalar
in "<unicode string>", line 23, column 13:
name: ||'Q '|| num_qdr
^
expected chomping or indentation indicators, but found '|'
in "<unicode string>", line 23, column 14:
name: ||'Q '|| num_qdr
^
CONTEXT: Traceback (most recent call last):
PL/Python function "yaml_to_jsonb", line 4, in <module>
return json.dumps( yaml.safe_load(p_yaml) )
PL/Python function "yaml_to_jsonb", line 161, in safe_load
PL/Python function "yaml_to_jsonb", line 113, in load
PL/Python function "yaml_to_jsonb", line 48, in get_single_data
PL/Python function "yaml_to_jsonb", line 35, in get_single_node
PL/Python function "yaml_to_jsonb", line 54, in compose_document
PL/Python function "yaml_to_jsonb", line 83, in compose_node
PL/Python function "yaml_to_jsonb", line 132, in compose_mapping_node
PL/Python function "yaml_to_jsonb", line 83, in compose_node
PL/Python function "yaml_to_jsonb", line 132, in compose_mapping_node
PL/Python function "yaml_to_jsonb", line 83, in compose_node
PL/Python function "yaml_to_jsonb", line 132, in compose_mapping_node
PL/Python function "yaml_to_jsonb", line 81, in compose_node
PL/Python function "yaml_to_jsonb", line 110, in compose_sequence_node
PL/Python function "yaml_to_jsonb", line 83, in compose_node
PL/Python function "yaml_to_jsonb", line 132, in compose_mapping_node
PL/Python function "yaml_to_jsonb", line 63, in compose_node
PL/Python function "yaml_to_jsonb", line 97, in check_event
PL/Python function "yaml_to_jsonb", line 448, in parse_block_mapping_value
PL/Python function "yaml_to_jsonb", line 115, in check_token
PL/Python function "yaml_to_jsonb", line 238, in fetch_more_tokens
PL/Python function "yaml_to_jsonb", line 634, in fetch_literal
PL/Python function "yaml_to_jsonb", line 648, in fetch_block_scalar
PL/Python function "yaml_to_jsonb", line 988, in scan_block_scalar
PL/Python function "yaml_to_jsonb", line 1086, in scan_block_scalar_indicators
PL/Python function "yaml_to_jsonb"
SQL function "yamlfile_to_jsonb" statement 1
SQL statement "
-- popula optim.donated_PackTpl a partir de tmp_orig.fdw_donatedPack
INSERT INTO optim.donated_PackTpl (donor_id, user_resp, pk_count, original_tpl, make_conf_tpl,info)
SELECT (
SELECT jurisd_base_id*1000000+donor_id
FROM optim.jurisdiction
WHERE lower(isolabel_ext) = lower(scope)
) AS donor_id, lower(user_resp) AS user_resp, pack_count, optim.replace_file_and_version(pg_read_file(optim.format_filepath(scope, donor_id, pack_count))) AS original_tpl, yamlfile_to_jsonb(optim.format_filepath(scope, donor_id, pack_count)) AS make_conf_tpl,
to_jsonb(t) AS info
FROM tmp_orig.fdw_donatedpackBR t
WHERE file_exists(optim.format_filepath(scope, donor_id, pack_count)) -- verificar make_conf.yaml ausentes
AND lst_vers=(select MAX(lst_vers) from tmp_orig.fdw_donatedpackBR where donor_id=t.donor_id )
ON CONFLICT (donor_id,pk_count)
DO UPDATE
SET original_tpl=EXCLUDED.original_tpl, make_conf_tpl=EXCLUDED.make_conf_tpl, kx_num_files=EXCLUDED.kx_num_files, info=EXCLUDED.info;
"
PL/pgSQL function optim.insert_donor_pack(text) line 64 at EXECUTE
make: *** [makefile:195: load_optim_csv] Error 1
O arquivo make_conf.yaml está com o formato errado, tive que comentar as linhas para continuar a ingestão
https://github.com/digital-guard/preserv-BR/commits/main/data/GO/AparecidaGoiania/_pk0084.01