Project

General

Profile

« Previous | Next » 

Revision 11707

bugfix: inputs/CVS/stemCount_/map.csv: ensure the aggregateoccurrence.sourceaccessioncode is always populated, because this is a required field when using sourceaccessioncodes. without it, the import will exclude rows which lack a value in this field because it cannot deduplicate on it for these rows, leading to the dropping of large numbers of occurrences. this shows up when comparing provider_count to the input table's row count, and produces the following error in the .errors table:
---
ERROR: duplicate key value violates unique constraint "aggregateoccurrence_taxonoccurrence_1_to_1"
DETAIL: Key (taxonoccurrence_id)=(1504108) already exists.
CONTEXT: SQL function "INSERT INTO aggregateoccurrence#1" statement 1
condition: sourceaccessioncode IS NULL
translated condition: "CVS.stemCount_.STEMCOUNT_ID" IS NULL
---
note that it uses the wrong unique constraint aggregateoccurrence_taxonoccurrence_1_to_1, because `sourceaccessioncode IS NULL` was true for some rows

View differences:

map.csv
1 1
CVS,VegCore,Filter,Comments
2
taxonImportance_ID,OMIT#taxonImportance_ID,,Omitted because STEMCOUNT_ID is more specific
2
taxonImportance_ID,aggregateOrganismObservationID,/_join/1,
3 3
taxonObservation_ID,taxonOccurrenceID,,
4 4
stratum_ID,*stratum_id,,
5 5
cover,coverPercent,,
......
16 16
cust_cvs_corner4Presence,*cust_cvs_corner4Presence,,
17 17
cust_cvs_corner5Presence,*cust_cvs_corner5Presence,,
18 18
cust_cvs_originalCoverCode,*cust_cvs_originalCoverCode,,
19
STEMCOUNT_ID,aggregateOrganismObservationID,,
19
STEMCOUNT_ID,aggregateOrganismObservationID,/_join/2,
20 20
stemDiameter,diameterBreastHeight_cm,,
21 21
stemDiameterAccuracy,*stemdiameteraccuracy,,
22 22
stemHeight,height_m,,

Also available in: Unified diff