You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2022/01/04 02:03:21 UTC

[GitHub] [druid] FrankChen021 commented on a change in pull request #12113: perf: cache row if it is a transformed row

FrankChen021 commented on a change in pull request #12113:
URL: https://github.com/apache/druid/pull/12113#discussion_r777787125



##########
File path: processing/src/main/java/org/apache/druid/segment/transform/Transformer.java
##########
@@ -170,15 +174,16 @@ public long getTimestampFromEpoch()
       }
     }
 
+    @Override
+    public long getTimestampFromEpoch()
+    {
+      return timestamp;
+    }
+
     @Override
     public DateTime getTimestamp()
     {
-      final RowFunction transform = transforms.get(ColumnHolder.TIME_COLUMN_NAME);
-      if (transform != null) {
-        return DateTimes.utc(getTimestampFromEpoch());
-      } else {
-        return row.getTimestamp();
-      }
+      return DateTimes.utc(getTimestampFromEpoch());

Review comment:
       Why not cache the `DateTime` object instead of the `long`? By doing that we can save many temp objects creation.




-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org

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



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