Add load in Spark code example
#2
by
lhoestq
HF staff
- opened
README.md
CHANGED
@@ -7,7 +7,15 @@ With Foursquare’s Open Source Places, you can access free data to accelerate g
|
|
7 |
|
8 |
## Prerequisites
|
9 |
|
10 |
-
In order to access Foursquare's Open Source Places data,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
|
12 |
- Parquet Files:
|
13 |
- **Places** - [release/dt=2024-12-03/places/parquet](https://huggingface.co/datasets/foursquare/fsq-os-places/tree/main/release/dt%3D2024-12-03/places/parquet)
|
|
|
7 |
|
8 |
## Prerequisites
|
9 |
|
10 |
+
In order to access Foursquare's Open Source Places data, it is recommended to use Spark. Here is how to load the Places data in Spark from Hugging Face.
|
11 |
+
|
12 |
+
- For Spark 3, you can use the `read_parquet` helper function from the [HF Spark documentation](https://huggingface.co/docs/hub/datasets-spark). It provides an easy API to load a Spark Dataframe from Hugging Face, without having to download the full dataset locally:
|
13 |
+
```python
|
14 |
+
places = read_parquet("hf://datasets/foursquare/fsq-os-places/release/dt=*/places/parquet/*.parquet")
|
15 |
+
```
|
16 |
+
- For Spark 4, there will be an official Hugging Face Spark data source available.
|
17 |
+
|
18 |
+
Alternatively you can download the following files to your local disk or cluster:
|
19 |
|
20 |
- Parquet Files:
|
21 |
- **Places** - [release/dt=2024-12-03/places/parquet](https://huggingface.co/datasets/foursquare/fsq-os-places/tree/main/release/dt%3D2024-12-03/places/parquet)
|