You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by GitBox <gi...@apache.org> on 2020/05/02 08:35:36 UTC

[GitHub] [incubator-iotdb] JulianFeinauer commented on a change in pull request #1146: [IOTDB-635]Added workaround when doing Aggregation over boolean Series.

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