Nintorac
commited on
Commit
·
a2999a7
1
Parent(s):
171001f
add duckdb with remote access to data tables
Browse files- README.md +27 -1
- lakh_remote.duckdb +3 -0
README.md
CHANGED
|
@@ -130,7 +130,33 @@ Structured using Data Vault 2.0 methodology:
|
|
| 130 |
|
| 131 |
## Usage Examples
|
| 132 |
|
| 133 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 134 |
|
| 135 |
## Data Quality Features
|
| 136 |
|
|
|
|
| 130 |
|
| 131 |
## Usage Examples
|
| 132 |
|
| 133 |
+
### Connecting to the Remote Database
|
| 134 |
+
|
| 135 |
+
You can attach to the remote Lakh MIDI database using DuckDB and query the processed data directly:
|
| 136 |
+
|
| 137 |
+
```sql
|
| 138 |
+
-- Attach the remote database
|
| 139 |
+
ATTACH 'hf://datasets/nintorac/ntrc_lakh_midi/lakh_remote.duckdb' AS lakh_remote;
|
| 140 |
+
|
| 141 |
+
-- Sample the artist profile mart table
|
| 142 |
+
CREATE TABLE my_artist_sample AS
|
| 143 |
+
SELECT * FROM lakh_remote.mart_artist_profile
|
| 144 |
+
WHERE artist_profile_tier = 'High Profile'
|
| 145 |
+
LIMIT 100;
|
| 146 |
+
|
| 147 |
+
|
| 148 |
+
-- Query the sample
|
| 149 |
+
SELECT
|
| 150 |
+
artist_name,
|
| 151 |
+
total_tracks,
|
| 152 |
+
avg_tempo,
|
| 153 |
+
most_common_key,
|
| 154 |
+
top_terms[1:3] as top_3_terms
|
| 155 |
+
FROM my_artist_sample
|
| 156 |
+
ORDER BY total_tracks DESC;
|
| 157 |
+
```
|
| 158 |
+
|
| 159 |
+
This approach allows you to fetch data from the gold layer, without having to manage the full silver layer locally.
|
| 160 |
|
| 161 |
## Data Quality Features
|
| 162 |
|
lakh_remote.duckdb
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3d2295bf78c10efacf09cd35e305ad495578de08e217e6c48df2b0dd1f9f3d56
|
| 3 |
+
size 274432
|