Skip to content

Commit

Permalink
simplify and improve day-of-week extraction (#67)
Browse files Browse the repository at this point in the history
  • Loading branch information
stepansergeevitch authored Oct 10, 2024
1 parent c49733c commit 501f51a
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/metabase/driver/firebolt.clj
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,7 @@
(defmethod sql.qp/date [:firebolt :year-of-era] [_ _ expr] (extract "year" expr))
; account for start of week setting in the :day-of-week implementation
(defmethod sql.qp/date [:firebolt :day-of-week] [_ _ expr]
(let [offset (driver.common/start-of-week-offset :firebolt)]
(if (not= offset 0)
(extract "isodow" (sql.qp/add-interval-honeysql-form :firebolt expr (- offset 7) :day))
(extract "isodow" expr)
)
))
(sql.qp/adjust-day-of-week :firebolt (extract "isodow" expr)))

; Return a appropriate HoneySQL form for converting a Unix timestamp integer field or value to an proper SQL Timestamp.
(defmethod sql.qp/unix-timestamp->honeysql [:firebolt :seconds] [_ _ expr] [[:to_timestamp expr]])
Expand Down

0 comments on commit 501f51a

Please sign in to comment.