Datasets:

License:
opt-sol commited on
Commit
5721cc1
·
verified ·
1 Parent(s): b991e5d

Update the index

Browse files
Files changed (1) hide show
  1. README.md +33 -3
README.md CHANGED
@@ -16,6 +16,36 @@ these sources do not share one.
16
  | FIGARO | [`OptimalSolution/databank-figaro`](https://huggingface.co/datasets/OptimalSolution/databank-figaro) | CC-BY-4.0 | 27 datasets | 862 MB |
17
  | Natural Earth | [`OptimalSolution/databank-basemaps`](https://huggingface.co/datasets/OptimalSolution/databank-basemaps) | public-domain | 2 layers, 4 resolutions | 41 MB |
18
 
19
- `index.json` is the machine-readable catalogue: every source,
20
- dataset and layer with its licence, coverage, size and manifest
21
- hash. It is generated from the manifests, never hand-edited.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  | FIGARO | [`OptimalSolution/databank-figaro`](https://huggingface.co/datasets/OptimalSolution/databank-figaro) | CC-BY-4.0 | 27 datasets | 862 MB |
17
  | Natural Earth | [`OptimalSolution/databank-basemaps`](https://huggingface.co/datasets/OptimalSolution/databank-basemaps) | public-domain | 2 layers, 4 resolutions | 41 MB |
18
 
19
+ ## Fetching, not browsing
20
+
21
+ These repos are built to be QUERIED, not downloaded. The files are
22
+ parquet and Hugging Face serves HTTP range requests, so a client reads
23
+ the footer, picks the row groups it needs and pulls only those column
24
+ chunks. Measured on an 11.8 MB partition of a 165.9M-row table:
25
+ **0.85 MB fetched, 7% of the file**, for a real slice.
26
+
27
+ `index.json` is what makes that possible without a directory listing.
28
+ It carries every source, dataset and layer with its licence, coverage,
29
+ size, column list, partition key, manifest hash and **the relative
30
+ path of every file** -- so a URL can be constructed rather than
31
+ discovered. It is generated from the manifests and never hand-edited.
32
+
33
+ ```r
34
+ library(duckdb); library(jsonlite)
35
+ idx <- fromJSON(paste0(hub, "/resolve/main/index.json"),
36
+ simplifyVector = FALSE)
37
+ # pick a source and dataset, then one entry from its `files` list
38
+ con <- dbConnect(duckdb())
39
+ dbExecute(con, "INSTALL httpfs; LOAD httpfs;")
40
+ dbGetQuery(con, sql) # read_parquet(url) over HTTP, no download
41
+ ```
42
+
43
+ ```python
44
+ import duckdb
45
+ duckdb.sql("INSTALL httpfs; LOAD httpfs;")
46
+ duckdb.sql(f"SELECT industry, sum(value) FROM '{url}' GROUP BY 1").df()
47
+ ```
48
+
49
+ The dataset viewer works too, but it is a preview: splits are named
50
+ `train` because that is Hugging Face's default for a dataset with no
51
+ train/test division, not because any of this is training data.