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
844d2035
Commit
844d2035
authored
9 years ago
by
Cam Saul
Browse files
Options
Downloads
Patches
Plain Diff
implementation of table columns that won't explode in large collections
parent
f6b8c56d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/metabase/driver/mongo.clj
+4
-3
4 additions, 3 deletions
src/metabase/driver/mongo.clj
with
4 additions
and
3 deletions
src/metabase/driver/mongo.clj
+
4
−
3
View file @
844d2035
...
...
@@ -24,9 +24,10 @@
[
table
]
(
with-mongo-connection
[
^
com.mongodb.DBApiLayer
conn
@
(
:db
table
)]
(
->>
(
mc/find-maps
conn
(
:name
table
))
(
r/map
keys
)
(
r/map
set
)
(
r/reduce
set/union
))))
(
take
10000
)
; it's probably enough to only consider the first 10,000 docs in the collection instead of iterating over potentially millions of them
(
map
keys
)
(
map
set
)
(
reduce
set/union
))))
(
defn-
field->base-type
"Determine the base type of FIELD in the most ghetto way possible, via `values->base-type`."
...
...
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