Skip to content

Commit

Permalink
Merge pull request #4 from swisscom-bigdata/fix/group_by_minute_and_hour
Browse files Browse the repository at this point in the history
Fixed group by minute and hour
  • Loading branch information
rawyler authored Aug 29, 2019
2 parents 3655ca3 + 327ee28 commit c0a6b34
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/metabase/driver/teradata.clj
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,9 @@
(def ^:private ^:const now (hsql/raw "CURRENT_TIMESTAMP"))

(defmethod sql.qp/date [:teradata :default] [_ _ expr] expr)
(defmethod sql.qp/date [:teradata :minute] [_ _ expr] (timestamp-trunc "yyyy-mm-dd hh24:mi" expr))
(defmethod sql.qp/date [:teradata :minute] [_ _ expr] (timestamp-trunc (hsql/raw "'yyyy-mm-dd hh24:mi'") expr))
(defmethod sql.qp/date [:teradata :minute-of-hour] [_ _ expr] (extract-integer :minute expr))
(defmethod sql.qp/date [:teradata :hour] [_ _ expr] (timestamp-trunc "yyyy-mm-dd hh24" expr))
(defmethod sql.qp/date [:teradata :hour] [_ _ expr] (timestamp-trunc (hsql/raw "'yyyy-mm-dd hh24'") expr))
(defmethod sql.qp/date [:teradata :hour-of-day] [_ _ expr] (extract-integer :hour expr))
(defmethod sql.qp/date [:teradata :day] [_ _ expr] (hx/->date expr))
(defmethod sql.qp/date [:teradata :day-of-week] [_ _ expr] (hx/inc (hx/- (sql.qp/date :day expr)
Expand Down

0 comments on commit c0a6b34

Please sign in to comment.