File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed
mcc/src/org/labkey/mcc/etl Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -43,9 +43,34 @@ public RecordedActionSet run(@NotNull PipelineJob job) throws PipelineJobExcepti
4343 populateForDemographics (job );
4444 populateForKinship (job );
4545
46+ // Check for duplicate IDs and proactively error:
47+ performDuplicateCheck (job );
48+
4649 return new RecordedActionSet ();
4750 }
4851
52+ private void performDuplicateCheck (PipelineJob job ) throws PipelineJobException
53+ {
54+ // Query aggregated demographics:
55+ UserSchema sourceSchema = QueryService .get ().getUserSchema (_containerUser .getUser (), _containerUser .getContainer (), MccSchema .NAME );
56+ if (sourceSchema == null )
57+ {
58+ throw new PipelineJobException ("Unable to find source schema: " + MccSchema .NAME );
59+ }
60+
61+ TableInfo sourceTi = sourceSchema .getTable ("duplicatedAggregatedDemographics" );
62+ if (sourceTi == null )
63+ {
64+ throw new PipelineJobException ("Unable to find table: duplicatedAggregatedDemographics" );
65+ }
66+
67+ TableSelector ts = new TableSelector (sourceTi );
68+ if (ts .exists ())
69+ {
70+ throw new PipelineJobException ("There were duplicated IDs in aggregatedDemographics" );
71+ }
72+ }
73+
4974 private void populateForDemographics (PipelineJob job ) throws PipelineJobException
5075 {
5176 // Query aggregated demographics:
You can’t perform that action at this time.
0 commit comments