Skip to content
Snippets Groups Projects
Unverified Commit 2b4ca3aa authored by Cam Saül's avatar Cam Saül
Browse files

Remove field-type from Druid test code :shower:

parent 0920f1d1
No related branches found
No related tags found
No related merge requests found
......@@ -65,12 +65,12 @@
;;; ### Sync
(defn- describe-table-field [druid-field-type field-name]
(merge {:name field-name}
;; all dimensions are Strings, and all metrics as JS Numbers, I think (?)
;; string-encoded booleans + dates are treated as strings (!)
(if (= :metric druid-field-type)
{:field-type :metric, :base-type :FloatField}
{:field-type :dimension, :base-type :TextField})))
;; all dimensions are Strings, and all metrics as JS Numbers, I think (?)
;; string-encoded booleans + dates are treated as strings (!)
{:name field-name
:base-type (if (= :metric druid-field-type)
:FloatField
:TextField)})
(defn- describe-table [database table]
(let [details (:details database)
......@@ -81,7 +81,6 @@
;; every Druid table is an event stream w/ a timestamp field
[{:name "timestamp"
:base-type :DateTimeField
:field-type :dimension
:pk? true}]
(map (partial describe-table-field :dimension) dimensions)
(map (partial describe-table-field :metric) metrics)))}))
......
......@@ -188,7 +188,7 @@
;; Sync the database
(sync-database/sync-database! db)
;; Add extra metadata like Field field-type, base-type, etc.
;; Add extra metadata like Field base-type, etc.
(doseq [^TableDefinition table-definition (:table-definitions database-definition)]
(let [table-name (:table-name table-definition)
table (delay (or (i/metabase-instance table-definition db)
......
......@@ -131,7 +131,7 @@
(defn create-field-definition
"Create a new `FieldDefinition`; verify its values."
^FieldDefinition [{:keys [field-name base-type field-type special-type visibility-type fk], :as field-definition-map}]
^FieldDefinition [field-definition-map]
(s/validate FieldDefinition (map->FieldDefinition field-definition-map)))
(defn create-table-definition
......
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