From fe8ace4f99cdd0af68605718d73d39aa44cf0e1a Mon Sep 17 00:00:00 2001 From: Alvaro Vega Date: Fri, 1 Mar 2024 11:05:29 +0100 Subject: [PATCH 1/2] setUniqueField from aggregation to features in all cases --- .../iot/cygnus/sinks/NGSIArcgisFeatureTableSink.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/cygnus-ngsi/src/main/java/com/telefonica/iot/cygnus/sinks/NGSIArcgisFeatureTableSink.java b/cygnus-ngsi/src/main/java/com/telefonica/iot/cygnus/sinks/NGSIArcgisFeatureTableSink.java index b4b8e5d29..0b7944d57 100644 --- a/cygnus-ngsi/src/main/java/com/telefonica/iot/cygnus/sinks/NGSIArcgisFeatureTableSink.java +++ b/cygnus-ngsi/src/main/java/com/telefonica/iot/cygnus/sinks/NGSIArcgisFeatureTableSink.java @@ -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()){ @@ -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); From c21756d156da74087d3a9b1d8ed4d8018b62c25b Mon Sep 17 00:00:00 2001 From: Alvaro Vega Date: Fri, 1 Mar 2024 11:08:25 +0100 Subject: [PATCH 2/2] update CNR --- CHANGES_NEXT_RELEASE | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES_NEXT_RELEASE b/CHANGES_NEXT_RELEASE index c1f10d9ee..3b99cda05 100644 --- a/CHANGES_NEXT_RELEASE +++ b/CHANGES_NEXT_RELEASE @@ -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)