Skip to content

Commit

Permalink
fix: attributes and sub-attributes naming in aggregation
Browse files Browse the repository at this point in the history
  • Loading branch information
ranim-n committed Dec 17, 2024
1 parent 185a4e1 commit 074dfe1
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ public static LinkedHashMap<String, ArrayList<JsonElement>> cropLinkedHashMap(Li

public void aggregateInitialAttributes(String attributePrefix, ArrayList<AttributesLD> attributes, LinkedHashMap<String, ArrayList<JsonElement>> aggregation ) {
for (AttributesLD attribute : attributes) {
String attrName = (attributePrefix.isEmpty() ? attribute.getAttrName() : attributePrefix + "_") + attribute.getAttrName();
String attrName = (attributePrefix.isEmpty() ? attributePrefix : attributePrefix + "_") + attribute.getAttrName();
aggregation.put(attrName, new ArrayList<>());
aggregation.put(attrName + NGSIConstants.AUTOGENERATED_ATTR_TYPE, new ArrayList<>());
if (attribute.isHasSubAttrs()) {
Expand All @@ -333,7 +333,7 @@ public void aggregateInitialAttributes(String attributePrefix, ArrayList<Attribu

public void aggregateAttributeValues(String attributePrefix, ArrayList<AttributesLD> attributes, LinkedHashMap<String, ArrayList<JsonElement>> aggregation) {
for (AttributesLD attribute : attributes) {
String attrName = (attributePrefix.isEmpty() ? attribute.getAttrName() : attributePrefix + "_") + attribute.getAttrName();
String attrName = (attributePrefix.isEmpty() ? attributePrefix : attributePrefix + "_") + attribute.getAttrName();
String attrType = attribute.getAttrType();
JsonElement attrValue = new JsonPrimitive(attribute.getAttrValue());
if (aggregation.containsKey(attrName)) {
Expand Down

0 comments on commit 074dfe1

Please sign in to comment.