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
81edcd40
Unverified
Commit
81edcd40
authored
4 years ago
by
Cam Saul
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Tests for filtering by numeric columns in Druid (#10935) [ci druid] (#12561)
parent
718c2fdf
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
modules/drivers/druid/test/metabase/driver/druid/query_processor_test.clj
+51
-0
51 additions, 0 deletions
...druid/test/metabase/driver/druid/query_processor_test.clj
with
51 additions
and
0 deletions
modules/drivers/druid/test/metabase/driver/druid/query_processor_test.clj
+
51
−
0
View file @
81edcd40
...
...
@@ -582,3 +582,54 @@
:breakout
[
$venue_category_name
$user_name
]
:order-by
[[
:desc
[
:aggregation
0
]]
[
:asc
$checkins.venue_category_name
]]
:limit
5
}))))))
(
deftest
filter-by-numeric-column-test
(
mt/test-driver
:druid
(
testing
"Make sure we can filter by numeric columns (#10935)"
(
tqpt/with-flattened-dbdef
(
letfn
[(
compiled
[
query
]
(
->
(
qp/query->native
query
)
:query
(
select-keys
[
:filter
:queryType
])))]
(
testing
"scan query"
(
let
[
query
(
mt/mbql-query
checkins
{
:order-by
[[
:desc
$id
]]
:fields
[
$id
$venue_price
$venue_name
]
:filter
[
:=
$venue_price
1
]
:limit
5
})]
(
is
(
=
{
:filter
{
:type
:selector,
:dimension
"venue_price"
,
:value
1
}
:queryType
:scan
}
(
compiled
query
)))
(
is
(
=
[
"931"
"1"
"Kinaree Thai Bistro"
]
(
mt/first-row
(
qp/process-query
query
))))))
(
testing
"topN query"
(
let
[
query
(
mt/mbql-query
checkins
{
:aggregation
[[
:count
]]
:breakout
[
$venue_price
]
:filter
[
:=
$venue_price
1
]})]
(
is
(
=
{
:filter
{
:type
:selector,
:dimension
"venue_price"
,
:value
1
}
:queryType
:topN
}
(
compiled
query
)))
(
is
(
=
[
"1"
221
]
(
mt/first-row
(
qp/process-query
query
))))))
(
testing
"groupBy query"
(
let
[
query
(
mt/mbql-query
checkins
{
:aggregation
[[
:aggregation-options
[
:distinct
$checkins.venue_name
]
{
:name
"__count_0"
}]]
:breakout
[
$venue_category_name
$user_name
]
:order-by
[[
:desc
[
:aggregation
0
]]
[
:asc
$checkins.venue_category_name
]]
:filter
[
:=
$venue_price
1
]})]
(
is
(
=
{
:filter
{
:type
:selector,
:dimension
"venue_price"
,
:value
1
}
:queryType
:groupBy
}
(
compiled
query
)))
(
is
(
=
[
"Mexican"
"Conchúr Tihomir"
4
]
(
mt/first-row
(
qp/process-query
query
))))))
(
testing
"timeseries query"
(
let
[
query
(
mt/mbql-query
checkins
{
:aggregation
[[
:count
]]
:filter
[
:=
$venue_price
1
]})]
(
is
(
=
{
:queryType
:timeseries
:filter
{
:type
:selector,
:dimension
"venue_price"
,
:value
1
}}
(
compiled
query
)))
(
is
(
=
[
221
]
(
mt/first-row
(
qp/process-query
query
)))))))))))
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