Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: More test fixes #71

Merged
merged 4 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/metabase/driver/firebolt.clj
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@
; call REGEXP_MATCHES function when regex-match-first is called
(defmethod sql.qp/->honeysql [:firebolt :regex-match-first]
[_ [_ arg pattern]]
[:REGEXP_LIKE (sql.qp/->honeysql :firebolt arg) pattern])
[:REGEXP_EXTRACT (sql.qp/->honeysql :firebolt arg) pattern])

(defmethod sql.qp/->honeysql [:firebolt :contains]
[_ [_ field value options]]
Expand Down
8 changes: 4 additions & 4 deletions test/metabase/driver/firebolt_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -192,13 +192,13 @@
(is (= (map
#(str/replace % #"\s+" " ")
["DROP TABLE IF EXISTS \"test_data_users\""
"CREATE DIMENSION TABLE \"test_data_users\" (\"id\" INTEGER, \"name\" String NULL, \"last_login\" DateTime NULL, \"password\" String NULL) PRIMARY INDEX \"id\""
"CREATE DIMENSION TABLE \"test_data_users\" (\"id\" int, \"name\" text NULL, \"last_login\" timestamp NULL, \"password\" text NULL) PRIMARY INDEX \"id\""
"DROP TABLE IF EXISTS \"test_data_categories\""
"CREATE DIMENSION TABLE \"test_data_categories\" (\"id\" INTEGER, \"name\" String NULL) PRIMARY INDEX \"id\""
"CREATE DIMENSION TABLE \"test_data_categories\" (\"id\" int, \"name\" text NULL) PRIMARY INDEX \"id\""
"DROP TABLE IF EXISTS \"test_data_venues\""
"CREATE DIMENSION TABLE \"test_data_venues\" (\"id\" INTEGER, \"name\" String NULL, \"category_id\" Int NULL, \"latitude\" Float NULL, \"longitude\" Float NULL, \"price\" Int NULL) PRIMARY INDEX \"id\""
"CREATE DIMENSION TABLE \"test_data_venues\" (\"id\" int, \"name\" text NULL, \"category_id\" int NULL, \"latitude\" double precision NULL, \"longitude\" double precision NULL, \"price\" int NULL) PRIMARY INDEX \"id\""
"DROP TABLE IF EXISTS \"test_data_checkins\""
"CREATE DIMENSION TABLE \"test_data_checkins\" (\"id\" INTEGER, \"date\" Date NULL, \"user_id\" Int NULL, \"venue_id\" Int NULL) PRIMARY INDEX \"id\""])
"CREATE DIMENSION TABLE \"test_data_checkins\" (\"id\" int, \"date\" date NULL, \"user_id\" int NULL, \"venue_id\" int NULL) PRIMARY INDEX \"id\""])
(ddl/create-db-tables-ddl-statements :firebolt (-> (mt/get-dataset-definition dataset-defs/test-data)
(update :database-name #(str %)))))))))

Expand Down
4 changes: 2 additions & 2 deletions test/metabase/test/data/firebolt.clj
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
(sql-jdbc.tx/add-test-extensions! :firebolt)

; during unit tests don't treat firebolt as having FK support
(defmethod driver/database-supports? [:firebolt :foreign-keys] [_ _ _] (not config/is-test?))
(defmethod driver/database-supports? [:firebolt :test/jvm-timezone-setting] [_ _ _] false)
stepansergeevitch marked this conversation as resolved.
Show resolved Hide resolved

;;; ----------------------------------------------- Connection Details -----------------------------------------------

Expand Down Expand Up @@ -95,7 +95,7 @@
pk-field-name)))

; Implement this to set the type of primary key field
(defmethod sql.tx/pk-sql-type :firebolt [_] "INTEGER")
(defmethod sql.tx/pk-sql-type :firebolt [_] "int")

; I'm not sure why `driver/supports?` above doesn't rectify this, but make `add-fk-sql a noop
(defmethod sql.tx/add-fk-sql :firebolt [& _] nil)
Expand Down
Loading