iotdb-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [incubator-iotdb] JulianFeinauer commented on a change in pull request #1146: [IOTDB-635]Added workaround when doing Aggregation over boolean Series.
Date Sat, 02 May 2020 08:35:36 GMT

JulianFeinauer commented on a change in pull request #1146:
URL: https://github.com/apache/incubator-iotdb/pull/1146#discussion_r418931467



##########
File path: grafana/src/main/java/org/apache/iotdb/web/grafana/dao/impl/BasicDaoImpl.java
##########
@@ -98,8 +98,28 @@ public Object doInConnection(Connection connection) throws SQLException
{
     return (List<String>) jdbcTemplate.execute(connectionCallback);
   }
 
+  /**
+   * Note: If the query fails this could be due to AGGREGATIION like AVG on booleayn field.
+   * Thus, we then do a retry with FIRST aggregation.
+   * This should be solved better in the long run.
+   */
   @Override
   public List<TimeValues> querySeries(String s, Pair<ZonedDateTime, ZonedDateTime>
timeRange) {
+    try {
+      return querySeriesInternal(s, timeRange, function);
+    } catch (Exception e) {
+      logger.info("Execution failed, trying now with FIRST Function!");
+      // Try it with FIRST
+      try {
+        return querySeriesInternal(s, timeRange, "FIRST");
+      } catch (Exception e2) {
+        logger.warn("Even FIRST query did not succeed, returning NULL now", e2);
+        return null;

Review comment:
       +1, done




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



Mime
View raw message