Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Metabase
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Engineering Digital Service
Metabase
Commits
c50c1e8d
Commit
c50c1e8d
authored
9 years ago
by
Cam Saul
Browse files
Options
Downloads
Patches
Plain Diff
code cleanup
parent
00d773c1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/metabase/driver/query_processor_test.clj
+21
-21
21 additions, 21 deletions
test/metabase/driver/query_processor_test.clj
with
21 additions
and
21 deletions
test/metabase/driver/query_processor_test.clj
+
21
−
21
View file @
c50c1e8d
...
@@ -522,7 +522,7 @@
...
@@ -522,7 +522,7 @@
;; ## CUMULATIVE SUM
;; ## CUMULATIVE SUM
;; TODO - Should we move this into IDataset? It's only used here, but the logic might get a little more compilcated when we add more drivers
;; TODO - Should we move this into IDataset? It's only used here, but the logic might get a little more compilcated when we add more drivers
(
defn-
->sum-
field-
type
(
defn-
->sum-type
"Since summed integer fields come back as different types depending on which DB we're using, cast value V appropriately."
"Since summed integer fields come back as different types depending on which DB we're using, cast value V appropriately."
[
v
]
[
v
]
(
case
(
id-field-type
)
(
case
(
id-field-type
)
...
@@ -531,7 +531,7 @@
...
@@ -531,7 +531,7 @@
;; ### cum_sum w/o breakout should be treated the same as sum
;; ### cum_sum w/o breakout should be treated the same as sum
(
qp-expect-with-all-datasets
(
qp-expect-with-all-datasets
{
:rows
[[(
->sum-
field-
type
120
)]]
{
:rows
[[(
->sum-type
120
)]]
:columns
[
"sum"
]
:columns
[
"sum"
]
:cols
[{
:base_type
(
id-field-type
)
,
:special_type
:id,
:name
"sum"
,
:id
nil,
:table_id
nil,
:description
nil
}]}
:cols
[{
:base_type
(
id-field-type
)
,
:special_type
:id,
:name
"sum"
,
:id
nil,
:table_id
nil,
:description
nil
}]}
{
:source_table
(
id
:users
)
{
:source_table
(
id
:users
)
...
@@ -550,21 +550,21 @@
...
@@ -550,21 +550,21 @@
;; ### Cumulative sum w/ a different breakout field
;; ### Cumulative sum w/ a different breakout field
(
qp-expect-with-all-datasets
(
qp-expect-with-all-datasets
{
:rows
[[
"Broen Olujimi"
(
->sum-
field-
type
14
)]
{
:rows
[[
"Broen Olujimi"
(
->sum-type
14
)]
[
"Conchúr Tihomir"
(
->sum-
field-
type
21
)]
[
"Conchúr Tihomir"
(
->sum-type
21
)]
[
"Dwight Gresham"
(
->sum-
field-
type
34
)]
[
"Dwight Gresham"
(
->sum-type
34
)]
[
"Felipinho Asklepios"
(
->sum-
field-
type
36
)]
[
"Felipinho Asklepios"
(
->sum-type
36
)]
[
"Frans Hevel"
(
->sum-
field-
type
46
)]
[
"Frans Hevel"
(
->sum-type
46
)]
[
"Kaneonuskatew Eiran"
(
->sum-
field-
type
49
)]
[
"Kaneonuskatew Eiran"
(
->sum-type
49
)]
[
"Kfir Caj"
(
->sum-
field-
type
61
)]
[
"Kfir Caj"
(
->sum-type
61
)]
[
"Nils Gotam"
(
->sum-
field-
type
70
)]
[
"Nils Gotam"
(
->sum-type
70
)]
[
"Plato Yeshua"
(
->sum-
field-
type
71
)]
[
"Plato Yeshua"
(
->sum-type
71
)]
[
"Quentin Sören"
(
->sum-
field-
type
76
)]
[
"Quentin Sören"
(
->sum-type
76
)]
[
"Rüstem Hebel"
(
->sum-
field-
type
91
)]
[
"Rüstem Hebel"
(
->sum-type
91
)]
[
"Shad Ferdynand"
(
->sum-
field-
type
97
)]
[
"Shad Ferdynand"
(
->sum-type
97
)]
[
"Simcha Yan"
(
->sum-
field-
type
101
)]
[
"Simcha Yan"
(
->sum-type
101
)]
[
"Spiros Teofil"
(
->sum-
field-
type
112
)]
[
"Spiros Teofil"
(
->sum-type
112
)]
[
"Szymon Theutrich"
(
->sum-
field-
type
120
)]]
[
"Szymon Theutrich"
(
->sum-type
120
)]]
:columns
[(
format-name
"name"
)
:columns
[(
format-name
"name"
)
"sum"
]
"sum"
]
:cols
[(
users-col
:name
)
:cols
[(
users-col
:name
)
...
@@ -580,10 +580,10 @@
...
@@ -580,10 +580,10 @@
"sum"
]
"sum"
]
:cols
[(
venue-col
:price
)
:cols
[(
venue-col
:price
)
{
:base_type
(
id-field-type
)
,
:special_type
:id,
:name
"sum"
,
:id
nil,
:table_id
nil,
:description
nil
}]
{
:base_type
(
id-field-type
)
,
:special_type
:id,
:name
"sum"
,
:id
nil,
:table_id
nil,
:description
nil
}]
:rows
[[
1
(
->sum-
field-
type
1211
)]
:rows
[[
1
(
->sum-type
1211
)]
[
2
(
->sum-
field-
type
4066
)]
[
2
(
->sum-type
4066
)]
[
3
(
->sum-
field-
type
4681
)]
[
3
(
->sum-type
4681
)]
[
4
(
->sum-
field-
type
5050
)]]}
[
4
(
->sum-type
5050
)]]}
{
:source_table
(
id
:venues
)
{
:source_table
(
id
:venues
)
:breakout
[(
id
:venues
:price
)]
:breakout
[(
id
:venues
:price
)]
:aggregation
[
"cum_sum"
(
id
:venues
:id
)]})
:aggregation
[
"cum_sum"
(
id
:venues
:id
)]})
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment