Skip to content

Commit

Permalink
Merge pull request #2350 from telefonicaid/fix/set_uniqueField_from_a…
Browse files Browse the repository at this point in the history
…ggregation_to_feature_always

setUniqueField from aggregation to features in all cases
  • Loading branch information
danielvillalbamota authored Mar 1, 2024
2 parents 2f2a0a1 + c21756d commit bf27969
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGES_NEXT_RELEASE
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
[cygnus-common] Upgrade postgresql from 42.4.3 to 42.7.2
[cygnus-common] [arcgis] Fix: check feature attributes containsKey before get it (#2347)
[cygnus-ngsi] [arcgis-sink] Set always uniqueField from aggregator for all features (#2349)
Original file line number Diff line number Diff line change
Expand Up @@ -385,12 +385,10 @@ public void persistAggregation(NGSIArcgisAggregator aggregator) throws CygnusRun
+ " is new: " + isNewFeatureTable);
ArcgisFeatureTable featureTable = getPersistenceBackend(featureTableUrl);

// If it's a new one, sets uniqueField value
if (isNewFeatureTable) {
LOGGER.debug("[" + this.getName() + "] Created new backend for " + featureTableUrl
+ " with uniqueField: " + aggregation.getUniqueField());
featureTable.setUniqueField(aggregation.getUniqueField());
}
// Sets always uniqueField value
LOGGER.debug("[" + this.getName() + "] Backend for " + featureTableUrl
+ " with uniqueField: " + aggregation.getUniqueField());
featureTable.setUniqueField(aggregation.getUniqueField());

featureTable.addToBatch(aggregation.getFeature());
if (featureTable.hasError()){
Expand Down Expand Up @@ -514,6 +512,7 @@ public void aggregate(NGSIEvent event) throws CygnusRuntimeError {
String entityType = contextElement.getType();

// Set unique filed and it's value.
LOGGER.debug("[NGSIArcgisAggregator] aggregate - uniqueField ->" + entityType);
aggregation.setUniqueField(entityType);
feature.addAttribute(entityType, entityId);

Expand Down

0 comments on commit bf27969

Please sign in to comment.