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
be3b4015
Unverified
Commit
be3b4015
authored
7 years ago
by
Kyle Doherty
Browse files
Options
Downloads
Plain Diff
Merge branch 'fingerprints-poc' of github.com:metabase/metabase into fingerprints-poc
parents
09213c0c
4f8dcb67
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/metabase/api/fingerprint.clj
+1
-1
1 addition, 1 deletion
src/metabase/api/fingerprint.clj
src/metabase/fingerprinting/core.clj
+12
-6
12 additions, 6 deletions
src/metabase/fingerprinting/core.clj
with
13 additions
and
7 deletions
src/metabase/api/fingerprint.clj
+
1
−
1
View file @
be3b4015
...
...
@@ -33,7 +33,7 @@
{
:query
(
keyword
query
)
:computation
(
keyword
computation
)})
(
api/defendpoint
GET
"/field/:id
/:max_query_cost/:max_computation_cost
"
(
api/defendpoint
GET
"/field/:id"
"Get fingerprint for a `Field` with ID."
[
id
max_query_cost
max_computation_cost
]
{
max_query_cost
MaxQueryCost
...
...
This diff is collapsed.
Click to expand it.
src/metabase/fingerprinting/core.clj
+
12
−
6
View file @
be3b4015
...
...
@@ -56,14 +56,16 @@
(
defmethod
fingerprint
(
type
Field
)
[
opts
field
]
{
:fingerprint
(
->>
(
metadata/field-values
field
(
extract-query-opts
opts
))
(
fingerprint-field
opts
field
))})
(
fingerprint-field
opts
field
)
(
merge
{
:table
(
Table
(
:table_id
field
))}))})
(
defmethod
fingerprint
(
type
Table
)
[
opts
table
]
{
:constituents
(
fingerprint-query
opts
(
metadata/query-values
(
:db_id
table
)
(
merge
(
extract-query-opts
opts
)
{
:source-table
(
:id
table
)})))})
{
:source-table
(
:id
table
)})))
:fingerprint
{
:table
table
}})
(
defmethod
fingerprint
(
type
Card
)
[
opts
card
]
...
...
@@ -75,14 +77,18 @@
fields
[(
first
breakout
)
(
or
(
first
aggregation
)
(
second
breakout
))]]
{
:constituents
[(
fingerprint-field
opts
(
first
fields
)
(
map
first
rows
))
(
fingerprint-field
opts
(
second
fields
)
(
map
second
rows
))]
:fingerprint
(
fingerprint-field
opts
fields
rows
)}))
:fingerprint
(
merge
(
fingerprint-field
opts
fields
rows
)
{
:card
card
:table
(
Table
(
:table_id
card
))})}))
(
defmethod
fingerprint
(
type
Segment
)
[
opts
segment
]
{
:constituents
(
fingerprint-query
opts
(
metadata/query-values
(
metadata/db-id
segment
)
(
merge
(
extract-query-opts
opts
)
(
:definition
segment
))))})
(
:definition
segment
))))
:fingerprint
{
:table
(
Table
(
:table_id
segment
))
:segment
segment
}})
(
defmethod
fingerprint
(
type
Metric
)
[
_
metric
]
...
...
@@ -138,5 +144,5 @@
"Walk the fingerprint structure and prettify all fingerprints within."
[
fingerprint
]
(
->
fingerprint
(
update
:fingerprint
f/prettify
)
(
update
:constituents
(
partial
map
prettify
))))
(
update
:fingerprint
f/prettify
)
(
update
:constituents
(
partial
map
f/
prettify
))))
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