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
8e70ad97
Commit
8e70ad97
authored
8 years ago
by
Benyounes Moumni
Browse files
Options
Downloads
Patches
Plain Diff
add test of sorting by timestamp on raw data queries
parent
61038f33
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/timeseries_query_processor_test.clj
+60
-0
60 additions, 0 deletions
test/metabase/timeseries_query_processor_test.clj
with
60 additions
and
0 deletions
test/metabase/timeseries_query_processor_test.clj
+
60
−
0
View file @
8e70ad97
...
...
@@ -69,6 +69,44 @@
(
data
(
data/run-query
checkins
(
ql/limit
2
))))
;;; "bare rows" query, limit, order-by timestamp desc
(
expect-with-timeseries-dbs
{
:columns
[
"id"
"timestamp"
"count"
"user_last_login"
"user_name"
"venue_category_name"
"venue_latitude"
"venue_longitude"
"venue_name"
"venue_price"
]
:rows
[[
"693"
,
"2015-12-29T08:00:00.000Z"
,
1
,
"2014-07-03T19:30:00.000Z"
,
"Frans Hevel"
,
"Mexican"
,
"34.0489"
,
"-118.238"
,
"Señor Fish"
,
"2"
]
[
"570"
,
"2015-12-26T08:00:00.000Z"
,
1
,
"2014-07-03T01:30:00.000Z"
,
"Kfir Caj"
,
"Chinese"
,
"37.7949"
,
"-122.406"
,
"Empress of China"
,
"3"
]]}
(
data
(
data/run-query
checkins
(
ql/order-by
(
ql/desc
$timestamp
))
(
ql/limit
2
))))
;;; "bare rows" query, limit, order-by timestamp asc
(
expect-with-timeseries-dbs
{
:columns
[
"id"
"timestamp"
"count"
"user_last_login"
"user_name"
"venue_category_name"
"venue_latitude"
"venue_longitude"
"venue_name"
"venue_price"
]
:rows
[[
"931"
,
"2013-01-03T08:00:00.000Z"
,
1
,
"2014-01-01T08:30:00.000Z"
,
"Simcha Yan"
,
"Thai"
,
"34.094"
,
"-118.344"
,
"Kinaree Thai Bistro"
,
"1"
]
[
"285"
,
"2013-01-10T08:00:00.000Z"
,
1
,
"2014-07-03T01:30:00.000Z"
,
"Kfir Caj"
,
"Thai"
,
"34.1021"
,
"-118.306"
,
"Ruen Pair Thai Restaurant"
,
"2"
]]}
(
data
(
data/run-query
checkins
(
ql/order-by
(
ql/asc
$timestamp
))
(
ql/limit
2
))))
;;; fields clause
(
expect-with-timeseries-dbs
{
:columns
[
"venue_name"
"venue_category_name"
"timestamp"
]
,
...
...
@@ -78,6 +116,28 @@
(
ql/fields
$venue_name
$venue_category_name
)
(
ql/limit
2
))))
;;; fields clause, order by timestamp asc
(
expect-with-timeseries-dbs
{
:columns
[
"venue_name"
"venue_category_name"
"timestamp"
]
,
:rows
[[
"Kinaree Thai Bistro"
"Thai"
"2013-01-03T08:00:00.000Z"
]
[
"Ruen Pair Thai Restaurant"
"Thai"
"2013-01-10T08:00:00.000Z"
]]}
(
data
(
data/run-query
checkins
(
ql/fields
$venue_name
$venue_category_name
)
(
ql/order-by
(
ql/asc
$timestamp
))
(
ql/limit
2
))))
;;; fields clause, order by timestamp desc
(
expect-with-timeseries-dbs
{
:columns
[
"venue_name"
"venue_category_name"
"timestamp"
]
,
:rows
[[
"Señor Fish"
"Mexican"
"2015-12-29T08:00:00.000Z"
]
[
"Empress of China"
"Chinese"
"2015-12-26T08:00:00.000Z"
]]}
(
data
(
data/run-query
checkins
(
ql/fields
$venue_name
$venue_category_name
)
(
ql/order-by
(
ql/desc
$timestamp
))
(
ql/limit
2
))))
;;; count
(
expect-with-timeseries-dbs
[
1000
]
...
...
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