You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@streampipes.apache.org by ze...@apache.org on 2022/07/26 09:27:18 UTC

[incubator-streampipes] branch STREAMPIPES-545 updated: [hotfix] Do not lowecase data lake measurements in query builder

This is an automated email from the ASF dual-hosted git repository.

zehnder pushed a commit to branch STREAMPIPES-545
in repository https://gitbox.apache.org/repos/asf/incubator-streampipes.git


The following commit(s) were added to refs/heads/STREAMPIPES-545 by this push:
     new d62815e00 [hotfix] Do not lowecase data lake measurements in query builder
d62815e00 is described below

commit d62815e004b7c3949e33f5d02a931feb307b22a1
Author: Philipp Zehnder <ze...@fzi.de>
AuthorDate: Tue Jul 26 11:26:23 2022 +0200

    [hotfix] Do not lowecase data lake measurements in query builder
---
 .../dataexplorer/sdk/DataLakeQueryBuilder.java          | 17 +++++------------
 1 file changed, 5 insertions(+), 12 deletions(-)

diff --git a/streampipes-data-explorer/src/main/java/org/apache/streampipes/dataexplorer/sdk/DataLakeQueryBuilder.java b/streampipes-data-explorer/src/main/java/org/apache/streampipes/dataexplorer/sdk/DataLakeQueryBuilder.java
index 3dcf993d5..2e36e49da 100644
--- a/streampipes-data-explorer/src/main/java/org/apache/streampipes/dataexplorer/sdk/DataLakeQueryBuilder.java
+++ b/streampipes-data-explorer/src/main/java/org/apache/streampipes/dataexplorer/sdk/DataLakeQueryBuilder.java
@@ -61,16 +61,14 @@ public class DataLakeQueryBuilder {
   public DataLakeQueryBuilder withAggregatedColumn(String columnName,
                                                    ColumnFunction columnFunction,
                                                    String targetName) {
-    String transformedColumnName = transform(columnName);
-    String transformedTargetName = transform(targetName);
     if (columnFunction == ColumnFunction.COUNT) {
-      this.selectionQuery.count(transformedColumnName).as(transformedTargetName);
+      this.selectionQuery.count(columnName).as(targetName);
     } else if (columnFunction == ColumnFunction.MEAN) {
-      this.selectionQuery.mean(transformedColumnName).as(transformedTargetName);
+      this.selectionQuery.mean(columnName).as(targetName);
     } else if (columnFunction == ColumnFunction.MIN) {
-      this.selectionQuery.min(transformedColumnName).as(transformedTargetName);
+      this.selectionQuery.min(columnName).as(targetName);
     } else if (columnFunction == ColumnFunction.MAX) {
-      this.selectionQuery.max(transformedColumnName).as(transformedTargetName);
+      this.selectionQuery.max(columnName).as(targetName);
     }
 
     // TODO implement all column functions
@@ -109,7 +107,7 @@ public class DataLakeQueryBuilder {
                                                   List<?> values) {
     List<ConjunctionClause> or = new ArrayList<>();
     values.forEach(value -> {
-      or.add(new OrConjunction(new SimpleClause(transform(field), operator, value)));
+      or.add(new OrConjunction(new SimpleClause(field, operator, value)));
     });
 
     NestedClause nestedClause = new NestedClause(or);
@@ -147,11 +145,6 @@ public class DataLakeQueryBuilder {
     return this;
   }
 
-
-  private String transform(String column) {
-    return column.toLowerCase();
-  }
-
   public Query build() {
     var selectQuery = this.selectionQuery.from(BackendConfig.INSTANCE.getInfluxDatabaseName(), measurementId);
     this.whereClauses.forEach(selectQuery::where);