Skip to content
Snippets Groups Projects
Commit 1be1f864 authored by Cam Saül's avatar Cam Saül
Browse files

Merge pull request #2232 from swisscom-bigdata/fix-truncate-relative-datetime-druid

Druid- Truncate of relative datetime should happen even if value of unit is 0
parents 82d2ba04 e1a1d576
No related branches found
No related tags found
No related merge requests found
......@@ -44,9 +44,7 @@
DateTimeField (->rvalue [this] (->rvalue (:field this)))
Value (->rvalue [this] (:value this))
DateTimeValue (->rvalue [{{unit :unit} :field, value :value}] (u/date->iso-8601 (u/date-trunc-or-extract unit value)))
RelativeDateTimeValue (->rvalue [{:keys [unit amount]}] (if (zero? amount)
(u/date->iso-8601)
(u/date->iso-8601 (u/date-trunc-or-extract unit (u/relative-date unit amount))))))
RelativeDateTimeValue (->rvalue [{:keys [unit amount]}] (u/date->iso-8601 (u/date-trunc-or-extract unit (u/relative-date unit amount)))))
(defprotocol ^:private IDimensionOrMetric
(^:private dimension-or-metric? [this]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment