xiaohui-sun closed pull request #3608: [TE] detection - convert algo timestamps 
to dataset timezone
URL: https://github.com/apache/incubator-pinot/pull/3608
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

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 583e18db90..9ebe70d473 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.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 @@ private TimeSeriesResponse 
getTimeSeriesResponseImpl(AnomalyFunctionDTO anomalyF
 
     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);
 


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to