You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by ak...@apache.org on 2020/03/23 16:26:36 UTC

[incubator-pinot] branch master updated: [TE] Remove hard-coded server data datetimeformatter (#5171)

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

akshayrai09 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 562180d  [TE] Remove hard-coded server data datetimeformatter (#5171)
562180d is described below

commit 562180dde5a8385eb651c01a480a24bda957f4c8
Author: Xiaohui Sun <xh...@linkedin.com>
AuthorDate: Mon Mar 23 09:26:27 2020 -0700

    [TE] Remove hard-coded server data datetimeformatter (#5171)
    
    We should not hard-code the server datetime as UTC.
    The datetime information should come from dataset configuration.
---
 .../datasource/pinot/resultset/ThirdEyeResultSetUtils.java        | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/datasource/pinot/resultset/ThirdEyeResultSetUtils.java b/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/datasource/pinot/resultset/ThirdEyeResultSetUtils.java
index 1bb0ffe..9bd622d 100644
--- a/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/datasource/pinot/resultset/ThirdEyeResultSetUtils.java
+++ b/thirdeye/thirdeye-pinot/src/main/java/org/apache/pinot/thirdeye/datasource/pinot/resultset/ThirdEyeResultSetUtils.java
@@ -90,15 +90,11 @@ public class ThirdEyeResultSetUtils {
       dataGranularity = dataTimeSpec.getDataGranularity();
       boolean isISOFormat = false;
       DateTimeFormatter inputDataDateTimeFormatter = null;
-      DateTimeFormatter serverDataDateTimeFormatter = null;
       String timeFormat = dataTimeSpec.getFormat();
       if (timeFormat != null && !timeFormat.equals(TimeSpec.SINCE_EPOCH_FORMAT)) {
         isISOFormat = true;
         inputDataDateTimeFormatter = DateTimeFormat.forPattern(timeFormat).withZone(dateTimeZone);
       }
-      if (isISOFormat && (sourceName.equals(MYSQL) || sourceName.equals(H2))) {
-        serverDataDateTimeFormatter = DateTimeFormat.forPattern(timeFormat).withZone(DateTimeZone.getDefault());
-      }
 
       List<ThirdEyeResultSet> resultSets = entry.getValue();
       for (int i = 0; i < resultSets.size(); i++) {
@@ -123,11 +119,7 @@ public class ThirdEyeResultSetUtils {
                 if (!isISOFormat) {
                   millis = dataGranularity.toMillis(Double.valueOf(groupKeyVal).longValue());
                 } else {
-                  if (sourceName.equals(MYSQL)) {
-                    millis = DateTime.parse(groupKeyVal, serverDataDateTimeFormatter).getMillis();
-                  } else {
                     millis = DateTime.parse(groupKeyVal, inputDataDateTimeFormatter).getMillis();
-                  }
                 }
                 if (millis < startTime) {
                   LOG.error("Data point earlier than requested start time {}: {}", new Date(startTime), new Date(millis));


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