Skip to content
Snippets Groups Projects
Unverified Commit 25b1bcd9 authored by Cam Saul's avatar Cam Saul Committed by GitHub
Browse files

Fix regression against syncing SparkSQL string type caused by #10207 (#10222)

parent b11acfd0
No related branches found
No related tags found
No related merge requests found
......@@ -23,25 +23,26 @@
(defmethod sql-jdbc.sync/database-type->base-type :hive-like [_ database-type]
(condp re-matches (name database-type)
#"boolean" :type/Boolean
#"tinyint" :type/Integer
#"smallint" :type/Integer
#"int" :type/Integer
#"bigint" :type/BigInteger
#"float" :type/Float
#"double" :type/Float
#"double precision" :type/Double
#"decimal.*" :type/Decimal
#"char.*" :type/Text
#"varchar.*" :type/Text
#"binary*" :type/*
#"date" :type/Date
#"time" :type/Time
#"timestamp" :type/DateTime
#"interval" :type/*
#"array.*" :type/Array
#"map" :type/Dictionary
#".*" :type/*))
#"boolean" :type/Boolean
#"tinyint" :type/Integer
#"smallint" :type/Integer
#"int" :type/Integer
#"bigint" :type/BigInteger
#"float" :type/Float
#"double" :type/Float
#"double precision" :type/Double
#"decimal.*" :type/Decimal
#"char.*" :type/Text
#"varchar.*" :type/Text
#"string.*" :type/Text
#"binary*" :type/*
#"date" :type/Date
#"time" :type/Time
#"timestamp" :type/DateTime
#"interval" :type/*
#"array.*" :type/Array
#"map" :type/Dictionary
#".*" :type/*))
(defmethod sql.qp/current-datetime-fn :hive-like [_] :%now)
......
(ns metabase.driver.hive-like-test
(:require [expectations :refer [expect]]
[metabase.driver.sql-jdbc.sync :as sql-jdbc.sync]))
;; make sure the various types we use for running tests are actually mapped to the correct DB type
(expect :type/Text (sql-jdbc.sync/database-type->base-type :hive-like :string))
(expect :type/Integer (sql-jdbc.sync/database-type->base-type :hive-like :int))
(expect :type/Date (sql-jdbc.sync/database-type->base-type :hive-like :date))
(expect :type/DateTime (sql-jdbc.sync/database-type->base-type :hive-like :timestamp))
(expect :type/Float (sql-jdbc.sync/database-type->base-type :hive-like :double))
(ns metabase.driver.sparksql-test
(:require [expectations :refer :all]
(:require [expectations :refer [expect]]
[metabase.driver.sql.query-processor :as sql.qp]))
;; Make sure our custom implementation of `apply-page` works the way we'd expect
......
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