@@ -118,17 +118,33 @@ public void complete(PipelineJob job, List<SequenceOutputFile> inputs, List<Sequ
118118
119119 Container target = job .getContainer ().isWorkbook () ? job .getContainer ().getParent () : job .getContainer ();
120120 TableInfo ti = QueryService .get ().getUserSchema (job .getUser (), target , mGAPSchema .NAME ).getTable (mGAPSchema .TABLE_VARIANT_CATALOG_RELEASES );
121- TableSelector ts = new TableSelector (ti , PageFlowUtil .set ("rowId " , "container" ), new SimpleFilter (FieldKey .fromString ("version" ), releaseVersion ), null );
121+ TableSelector ts = new TableSelector (ti , PageFlowUtil .set ("rowid " , "container" ), new SimpleFilter (FieldKey .fromString ("version" ), releaseVersion ), null );
122122 if (ts .exists ())
123123 {
124+ if (ts .getRowCount () > 1 )
125+ {
126+ throw new IllegalStateException ("More than one row found matching: " + releaseVersion );
127+ }
128+
124129 job .getLogger ().info ("Updating release record" );
125- Map <String , Object > row = ts .getValueMap ();
130+ Map <String , Object > row = ts .getMap ();
131+ if (!row .containsKey ("rowid" ) || row .get ("rowid" ) == null )
132+ {
133+ job .getLogger ().error ("Missing rowId, found: " );
134+ for (String key : row .keySet ())
135+ {
136+ job .getLogger ().debug (key + ": " + row .get (key ));
137+ }
138+
139+ throw new IllegalStateException ("Missing rowId from release record" );
140+ }
141+
126142 row .put ("luceneIndex" , of .get (0 ).getRowid ());
127143
128144 try
129145 {
130146 BatchValidationException bve = new BatchValidationException ();
131- Map <String , Object > oldKeys = Map .of ("rowId" , row .get ("rowId " ));
147+ Map <String , Object > oldKeys = Map .of ("rowId" , row .get ("rowid " ));
132148 ti .getUpdateService ().updateRows (job .getUser (), target , Collections .singletonList (row ), Collections .singletonList (oldKeys ), bve , null , null );
133149 }
134150 catch (BatchValidationException | InvalidKeyException | QueryUpdateServiceException | SQLException e )
0 commit comments