Commit
•
c50d71f
1
Parent(s):
85ed96d
Add load in Spark code example (#2)
Browse files- Add load in Spark code example (93609d7b0c06ff2f21d0b0c0fa1390337e87e6f1)
Co-authored-by: Quentin Lhoest <[email protected]>
README.md
CHANGED
@@ -12,7 +12,15 @@ With Foursquare’s Open Source Places, you can access free data to accelerate g
|
|
12 |
|
13 |
## Prerequisites
|
14 |
|
15 |
-
In order to access Foursquare's Open Source Places data,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
|
17 |
- Parquet Files:
|
18 |
- **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)
|
|
|
12 |
|
13 |
## Prerequisites
|
14 |
|
15 |
+
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.
|
16 |
+
|
17 |
+
- 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:
|
18 |
+
```python
|
19 |
+
places = read_parquet("hf://datasets/foursquare/fsq-os-places/release/dt=*/places/parquet/*.parquet")
|
20 |
+
```
|
21 |
+
- For Spark 4, there will be an official Hugging Face Spark data source available.
|
22 |
+
|
23 |
+
Alternatively you can download the following files to your local disk or cluster:
|
24 |
|
25 |
- Parquet Files:
|
26 |
- **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)
|