You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by xh...@apache.org on 2018/12/12 00:30:46 UTC

[incubator-pinot] branch master updated: [TE] detection - convert algo timestamps to dataset timezone (#3608)

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

xhsun pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git


The following commit(s) were added to refs/heads/master by this push:
     new fa12efd  [TE] detection - convert algo timestamps to dataset timezone (#3608)
fa12efd is described below

commit fa12efddc2a834729a875d4730ffe9c74543b3e5
Author: Alexander Pucher <ap...@linkedin.com>
AuthorDate: Tue Dec 11 16:30:42 2018 -0800

    [TE] detection - convert algo timestamps to dataset timezone (#3608)
---
 .../anomaly/detection/AnomalyDetectionInputContextBuilder.java    | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/thirdeye/thirdeye-pinot/src/main/java/com/linkedin/thirdeye/anomaly/detection/AnomalyDetectionInputContextBuilder.java b/thirdeye/thirdeye-pinot/src/main/java/com/linkedin/thirdeye/anomaly/detection/AnomalyDetectionInputContextBuilder.java
index 583e18d..9ebe70d 100644
--- a/thirdeye/thirdeye-pinot/src/main/java/com/linkedin/thirdeye/anomaly/detection/AnomalyDetectionInputContextBuilder.java
+++ b/thirdeye/thirdeye-pinot/src/main/java/com/linkedin/thirdeye/anomaly/detection/AnomalyDetectionInputContextBuilder.java
@@ -58,6 +58,7 @@ import org.apache.commons.collections.MapUtils;
 import org.apache.commons.lang.NullArgumentException;
 import org.apache.commons.lang3.StringUtils;
 import org.joda.time.DateTime;
+import org.joda.time.DateTimeZone;
 import org.quartz.JobExecutionException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -656,14 +657,17 @@ public class AnomalyDetectionInputContextBuilder {
 
     LOG.info("Found [{}] time ranges to fetch data for metric(s): {}, with filter: {}", startEndTimeRanges.size(), metricsToRetrieve, filters);
 
+    // NOTE: another ThirdEye-esque hack. This code is to be deprecated, so no value in refactoring it.
+    DateTimeZone timeZone = Utils.getDataTimeZone(anomalyFunctionSpec.getCollection());
+
     // MultiQuery request
     List<Future<TimeSeriesResponse>> futureResponses = new ArrayList<>();
     List<TimeSeriesRequest> requests = new ArrayList<>();
     Set<TimeSeriesRow> timeSeriesRowSet = new HashSet<>();
     for (Pair<Long, Long> startEndInterval : startEndTimeRanges) {
       TimeSeriesRequest request = new TimeSeriesRequest(seedRequest);
-      DateTime startTime = new DateTime(startEndInterval.getFirst());
-      DateTime endTime = new DateTime(startEndInterval.getSecond());
+      DateTime startTime = new DateTime(startEndInterval.getFirst(), timeZone);
+      DateTime endTime = new DateTime(startEndInterval.getSecond(), timeZone);
       request.setStart(startTime);
       request.setEnd(endTime);
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org