Skip to content

Commit

Permalink
1.0.0-metabase-v0.33.6-teradata-jdbc-16.20
Browse files Browse the repository at this point in the history
  • Loading branch information
rawyler committed Nov 22, 2019
1 parent c7bfe8b commit 987a9fa
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
.classpath
.project
.idea
*.iml
teradata-driver.iml
.lein-repl-history
2 changes: 1 addition & 1 deletion project.clj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(defproject metabase/teradata-driver "1.0.0-metabase-v0.33.2-teradata-jdbc-16.20"
(defproject metabase/teradata-driver "1.0.0-metabase-v0.33.6-teradata-jdbc-16.20"
:min-lein-version "2.5.0"

:profiles
Expand Down
8 changes: 4 additions & 4 deletions src/metabase/driver/teradata.clj
Original file line number Diff line number Diff line change
Expand Up @@ -141,18 +141,18 @@
(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)
(sql.qp/date :week expr))))
(defmethod sql.qp/date [:teradata :day-of-week] [driver _ expr] (hx/inc (hx/- (sql.qp/date driver :day expr)
(sql.qp/date driver :week expr))))
(defmethod sql.qp/date [:teradata :day-of-month] [_ _ expr] (extract-integer :day expr))
(defmethod sql.qp/date [:teradata :day-of-year] [_ _ expr] (hx/inc (hx/- (sql.qp/date :day expr) (date-trunc :year expr))))
(defmethod sql.qp/date [:teradata :day-of-year] [driver _ expr] (hx/inc (hx/- (sql.qp/date driver :day expr) (date-trunc :year expr))))
(defmethod sql.qp/date [:teradata :week] [_ _ expr] (date-trunc :day expr)) ; Same behaviour as with Oracle.
(defmethod sql.qp/date [:teradata :week-of-year] [_ _ expr] (hx/inc (hx// (hx/- (date-trunc :iw expr)
(date-trunc :iy expr))
7)))
(defmethod sql.qp/date [:teradata :month] [_ _ expr] (date-trunc :mm expr))
(defmethod sql.qp/date [:teradata :month-of-year] [_ _ expr] (extract-integer :month expr))
(defmethod sql.qp/date [:teradata :quarter] [_ _ expr] (date-trunc :q expr))
(defmethod sql.qp/date [:teradata :quarter-of-year] [_ _ expr] (hx// (hx/+ (sql.qp/date :month-of-year (sql.qp/date :quarter expr)) 2) 3))
(defmethod sql.qp/date [:teradata :quarter-of-year] [driver _ expr] (hx// (hx/+ (sql.qp/date driver :month-of-year (sql.qp/date driver :quarter expr)) 2) 3))
(defmethod sql.qp/date [:teradata :year] [_ _ expr] (extract-integer :year expr))

(defn- num-to-interval [unit amount]
Expand Down

0 comments on commit 987a9fa

Please sign in to comment.