Add IterableDataset.from_spark
NONE
_The documentation is not available anymore as the PR was closed or merged._
2023-04-19T10:46:06Z
https://github.com/huggingface/datasets/pull/5770#issuecomment-1514519592
https://api.github.com/repos/huggingface/datasets/issues/5770
IC_kwDODunzps5aRbwo
https://api.github.com/repos/huggingface/datasets/issues/comments/1514519592/reactions
2023-05-17T14:04:18Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1514519592
https://avatars.githubusercontent.com/u/99929124?v=4
https://api.github.com/users/HuggingFaceDocBuilderDev/events{/privacy}
https://api.github.com/users/HuggingFaceDocBuilderDev/followers
https://api.github.com/users/HuggingFaceDocBuilderDev/following{/other_user}
https://api.github.com/users/HuggingFaceDocBuilderDev/gists{/gist_id}
https://github.com/HuggingFaceDocBuilderDev
HuggingFaceDocBuilderDev
U_kgDOBfTMJA
https://api.github.com/users/HuggingFaceDocBuilderDev/orgs
https://api.github.com/users/HuggingFaceDocBuilderDev/received_events
https://api.github.com/users/HuggingFaceDocBuilderDev/repos
https://api.github.com/users/HuggingFaceDocBuilderDev/starred{/owner}{/repo}
https://api.github.com/users/HuggingFaceDocBuilderDev/subscriptions
User
https://api.github.com/users/HuggingFaceDocBuilderDev
public
CONTRIBUTOR
Hi again @lhoestq this is ready for review! Not sure I have permission to add people to the reviewers list...
2023-04-27T16:37:15Z
https://github.com/huggingface/datasets/pull/5770#issuecomment-1526009767
https://api.github.com/repos/huggingface/datasets/issues/5770
IC_kwDODunzps5a9Q-n
https://api.github.com/repos/huggingface/datasets/issues/comments/1526009767/reactions
2023-04-27T16:37:15Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1526009767
https://avatars.githubusercontent.com/u/106995444?v=4
https://api.github.com/users/maddiedawson/events{/privacy}
https://api.github.com/users/maddiedawson/followers
https://api.github.com/users/maddiedawson/following{/other_user}
https://api.github.com/users/maddiedawson/gists{/gist_id}
https://github.com/maddiedawson
maddiedawson
U_kgDOBmCe9A
https://api.github.com/users/maddiedawson/orgs
https://api.github.com/users/maddiedawson/received_events
https://api.github.com/users/maddiedawson/repos
https://api.github.com/users/maddiedawson/starred{/owner}{/repo}
https://api.github.com/users/maddiedawson/subscriptions
User
https://api.github.com/users/maddiedawson
public
MEMBER
Cool ! I think you can define `IterableDataset.from_spark` instead of adding `streaming=` in `Dataset.from_spark`, it can be more intuitive IMO :)
2023-04-27T16:42:34Z
https://github.com/huggingface/datasets/pull/5770#issuecomment-1526016689
https://api.github.com/repos/huggingface/datasets/issues/5770
IC_kwDODunzps5a9Sqx
https://api.github.com/repos/huggingface/datasets/issues/comments/1526016689/reactions
2023-04-27T16:42:34Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1526016689
https://avatars.githubusercontent.com/u/42851186?v=4
https://api.github.com/users/lhoestq/events{/privacy}
https://api.github.com/users/lhoestq/followers
https://api.github.com/users/lhoestq/following{/other_user}
https://api.github.com/users/lhoestq/gists{/gist_id}
https://github.com/lhoestq
lhoestq
MDQ6VXNlcjQyODUxMTg2
https://api.github.com/users/lhoestq/orgs
https://api.github.com/users/lhoestq/received_events
https://api.github.com/users/lhoestq/repos
https://api.github.com/users/lhoestq/starred{/owner}{/repo}
https://api.github.com/users/lhoestq/subscriptions
User
https://api.github.com/users/lhoestq
public
CONTRIBUTOR
Thanks for reviewing! I moved the streaming behavior to IterableDataset.from_spark
2023-04-27T17:11:01Z
https://github.com/huggingface/datasets/pull/5770#issuecomment-1526051117
https://api.github.com/repos/huggingface/datasets/issues/5770
IC_kwDODunzps5a9bEt
https://api.github.com/repos/huggingface/datasets/issues/comments/1526051117/reactions
2023-04-27T17:11:01Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1526051117
https://avatars.githubusercontent.com/u/106995444?v=4
https://api.github.com/users/maddiedawson/events{/privacy}
https://api.github.com/users/maddiedawson/followers
https://api.github.com/users/maddiedawson/following{/other_user}
https://api.github.com/users/maddiedawson/gists{/gist_id}
https://github.com/maddiedawson
maddiedawson
U_kgDOBmCe9A
https://api.github.com/users/maddiedawson/orgs
https://api.github.com/users/maddiedawson/received_events
https://api.github.com/users/maddiedawson/repos
https://api.github.com/users/maddiedawson/starred{/owner}{/repo}
https://api.github.com/users/maddiedawson/subscriptions
User
https://api.github.com/users/maddiedawson
public
CONTRIBUTOR
Thanks Quentin! I'll flesh out the docs in a follow-up PR
2023-05-03T23:37:08Z
https://github.com/huggingface/datasets/pull/5770#issuecomment-1533883151
https://api.github.com/repos/huggingface/datasets/issues/5770
IC_kwDODunzps5bbTMP
https://api.github.com/repos/huggingface/datasets/issues/comments/1533883151/reactions
2023-05-03T23:37:08Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1533883151
https://avatars.githubusercontent.com/u/106995444?v=4
https://api.github.com/users/maddiedawson/events{/privacy}
https://api.github.com/users/maddiedawson/followers
https://api.github.com/users/maddiedawson/following{/other_user}
https://api.github.com/users/maddiedawson/gists{/gist_id}
https://github.com/maddiedawson
maddiedawson
U_kgDOBmCe9A
https://api.github.com/users/maddiedawson/orgs
https://api.github.com/users/maddiedawson/received_events
https://api.github.com/users/maddiedawson/repos
https://api.github.com/users/maddiedawson/starred{/owner}{/repo}
https://api.github.com/users/maddiedawson/subscriptions
User
https://api.github.com/users/maddiedawson
public
CONTRIBUTOR
Friendly ping @lhoestq 
2023-05-08T15:55:29Z
https://github.com/huggingface/datasets/pull/5770#issuecomment-1538638309
https://api.github.com/repos/huggingface/datasets/issues/5770
IC_kwDODunzps5btcHl
https://api.github.com/repos/huggingface/datasets/issues/comments/1538638309/reactions
2023-05-08T15:55:29Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1538638309
https://avatars.githubusercontent.com/u/106995444?v=4
https://api.github.com/users/maddiedawson/events{/privacy}
https://api.github.com/users/maddiedawson/followers
https://api.github.com/users/maddiedawson/following{/other_user}
https://api.github.com/users/maddiedawson/gists{/gist_id}
https://github.com/maddiedawson
maddiedawson
U_kgDOBmCe9A
https://api.github.com/users/maddiedawson/orgs
https://api.github.com/users/maddiedawson/received_events
https://api.github.com/users/maddiedawson/repos
https://api.github.com/users/maddiedawson/starred{/owner}{/repo}
https://api.github.com/users/maddiedawson/subscriptions
User
https://api.github.com/users/maddiedawson
public
CONTRIBUTOR
Thanks @lhoestq ! I fixed the partition order thing and added more unit tests.
2023-05-10T05:28:57Z
https://github.com/huggingface/datasets/pull/5770#issuecomment-1541373460
https://api.github.com/repos/huggingface/datasets/issues/5770
IC_kwDODunzps5b334U
https://api.github.com/repos/huggingface/datasets/issues/comments/1541373460/reactions
2023-05-10T05:28:57Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1541373460
https://avatars.githubusercontent.com/u/106995444?v=4
https://api.github.com/users/maddiedawson/events{/privacy}
https://api.github.com/users/maddiedawson/followers
https://api.github.com/users/maddiedawson/following{/other_user}
https://api.github.com/users/maddiedawson/gists{/gist_id}
https://github.com/maddiedawson
maddiedawson
U_kgDOBmCe9A
https://api.github.com/users/maddiedawson/orgs
https://api.github.com/users/maddiedawson/received_events
https://api.github.com/users/maddiedawson/repos
https://api.github.com/users/maddiedawson/starred{/owner}{/repo}
https://api.github.com/users/maddiedawson/subscriptions
User
https://api.github.com/users/maddiedawson
public
NONE
<details>
<summary>Show benchmarks</summary>

PyArrow==8.0.0

<details>
<summary>Show updated benchmarks!</summary>

### Benchmark: benchmark_array_xd.json

| metric | read_batch_formatted_as_numpy after write_array2d | read_batch_formatted_as_numpy after write_flattened_sequence | read_batch_formatted_as_numpy after write_nested_sequence | read_batch_unformated after write_array2d | read_batch_unformated after write_flattened_sequence | read_batch_unformated after write_nested_sequence | read_col_formatted_as_numpy after write_array2d | read_col_formatted_as_numpy after write_flattened_sequence | read_col_formatted_as_numpy after write_nested_sequence | read_col_unformated after write_array2d | read_col_unformated after write_flattened_sequence | read_col_unformated after write_nested_sequence | read_formatted_as_numpy after write_array2d | read_formatted_as_numpy after write_flattened_sequence | read_formatted_as_numpy after write_nested_sequence | read_unformated after write_array2d | read_unformated after write_flattened_sequence | read_unformated after write_nested_sequence | write_array2d | write_flattened_sequence | write_nested_sequence |
|--------|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| new / old (diff) | 0.006165 / 0.011353 (-0.005188) | 0.004497 / 0.011008 (-0.006511) | 0.099142 / 0.038508 (0.060634) | 0.027479 / 0.023109 (0.004369) | 0.352491 / 0.275898 (0.076593) | 0.402993 / 0.323480 (0.079513) | 0.004885 / 0.007986 (-0.003100) | 0.003315 / 0.004328 (-0.001013) | 0.075787 / 0.004250 (0.071537) | 0.035320 / 0.037052 (-0.001732) | 0.368401 / 0.258489 (0.109912) | 0.409090 / 0.293841 (0.115249) | 0.030125 / 0.128546 (-0.098421) | 0.011670 / 0.075646 (-0.063976) | 0.324381 / 0.419271 (-0.094890) | 0.050815 / 0.043533 (0.007283) | 0.352598 / 0.255139 (0.097460) | 0.389189 / 0.283200 (0.105989) | 0.092873 / 0.141683 (-0.048810) | 1.485140 / 1.452155 (0.032986) | 1.545586 / 1.492716 (0.052869) |

### Benchmark: benchmark_getitem\_100B.json

| metric | get_batch_of\_1024\_random_rows | get_batch_of\_1024\_rows | get_first_row | get_last_row |
|--------|---|---|---|---|
| new / old (diff) | 0.199522 / 0.018006 (0.181516) | 0.404576 / 0.000490 (0.404087) | 0.003322 / 0.000200 (0.003122) | 0.000074 / 0.000054 (0.000020) |

### Benchmark: benchmark_indices_mapping.json

| metric | select | shard | shuffle | sort | train_test_split |
|--------|---|---|---|---|---|
| new / old (diff) | 0.022945 / 0.037411 (-0.014466) | 0.095512 / 0.014526 (0.080987) | 0.103077 / 0.176557 (-0.073480) | 0.163918 / 0.737135 (-0.573217) | 0.105560 / 0.296338 (-0.190779) |

### Benchmark: benchmark_iterating.json

| metric | read 5000 | read 50000 | read_batch 50000 10 | read_batch 50000 100 | read_batch 50000 1000 | read_formatted numpy 5000 | read_formatted pandas 5000 | read_formatted tensorflow 5000 | read_formatted torch 5000 | read_formatted_batch numpy 5000 10 | read_formatted_batch numpy 5000 1000 | shuffled read 5000 | shuffled read 50000 | shuffled read_batch 50000 10 | shuffled read_batch 50000 100 | shuffled read_batch 50000 1000 | shuffled read_formatted numpy 5000 | shuffled read_formatted_batch numpy 5000 10 | shuffled read_formatted_batch numpy 5000 1000 |
|--------|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| new / old (diff) | 0.417360 / 0.215209 (0.202151) | 4.161693 / 2.077655 (2.084039) | 1.851941 / 1.504120 (0.347821) | 1.649872 / 1.541195 (0.108677) | 1.682099 / 1.468490 (0.213609) | 0.693187 / 4.584777 (-3.891590) | 3.462528 / 3.745712 (-0.283184) | 1.839893 / 5.269862 (-3.429968) | 1.155945 / 4.565676 (-3.409731) | 0.082611 / 0.424275 (-0.341664) | 0.012076 / 0.007607 (0.004469) | 0.514325 / 0.226044 (0.288280) | 5.155052 / 2.268929 (2.886123) | 2.307280 / 55.444624 (-53.137345) | 1.966483 / 6.876477 (-4.909994) | 2.018892 / 2.142072 (-0.123181) | 0.803068 / 4.805227 (-4.002159) | 0.152213 / 6.500664 (-6.348451) | 0.066320 / 0.075469 (-0.009149) |

### Benchmark: benchmark_map_filter.json

| metric | filter | map fast-tokenizer batched | map identity | map identity batched | map no-op batched | map no-op batched numpy | map no-op batched pandas | map no-op batched pytorch | map no-op batched tensorflow |
|--------|---|---|---|---|---|---|---|---|---|
| new / old (diff) | 1.218578 / 1.841788 (-0.623209) | 13.563869 / 8.074308 (5.489561) | 13.954596 / 10.191392 (3.763204) | 0.151527 / 0.680424 (-0.528897) | 0.016655 / 0.534201 (-0.517546) | 0.380637 / 0.579283 (-0.198646) | 0.395854 / 0.434364 (-0.038509) | 0.459111 / 0.540337 (-0.081226) | 0.560219 / 1.386936 (-0.826717) |

</details>
PyArrow==latest

<details>
<summary>Show updated benchmarks!</summary>

### Benchmark: benchmark_array_xd.json

| metric | read_batch_formatted_as_numpy after write_array2d | read_batch_formatted_as_numpy after write_flattened_sequence | read_batch_formatted_as_numpy after write_nested_sequence | read_batch_unformated after write_array2d | read_batch_unformated after write_flattened_sequence | read_batch_unformated after write_nested_sequence | read_col_formatted_as_numpy after write_array2d | read_col_formatted_as_numpy after write_flattened_sequence | read_col_formatted_as_numpy after write_nested_sequence | read_col_unformated after write_array2d | read_col_unformated after write_flattened_sequence | read_col_unformated after write_nested_sequence | read_formatted_as_numpy after write_array2d | read_formatted_as_numpy after write_flattened_sequence | read_formatted_as_numpy after write_nested_sequence | read_unformated after write_array2d | read_unformated after write_flattened_sequence | read_unformated after write_nested_sequence | write_array2d | write_flattened_sequence | write_nested_sequence |
|--------|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| new / old (diff) | 0.006427 / 0.011353 (-0.004926) | 0.004728 / 0.011008 (-0.006280) | 0.080525 / 0.038508 (0.042017) | 0.027294 / 0.023109 (0.004185) | 0.414688 / 0.275898 (0.138790) | 0.449882 / 0.323480 (0.126402) | 0.004771 / 0.007986 (-0.003214) | 0.003402 / 0.004328 (-0.000926) | 0.078748 / 0.004250 (0.074497) | 0.037046 / 0.037052 (-0.000007) | 0.417398 / 0.258489 (0.158909) | 0.462921 / 0.293841 (0.169080) | 0.030364 / 0.128546 (-0.098182) | 0.011810 / 0.075646 (-0.063837) | 0.089787 / 0.419271 (-0.329485) | 0.039806 / 0.043533 (-0.003727) | 0.403401 / 0.255139 (0.148262) | 0.439477 / 0.283200 (0.156278) | 0.088431 / 0.141683 (-0.053252) | 1.534373 / 1.452155 (0.082219) | 1.592316 / 1.492716 (0.099600) |

### Benchmark: benchmark_getitem\_100B.json

| metric | get_batch_of\_1024\_random_rows | get_batch_of\_1024\_rows | get_first_row | get_last_row |
|--------|---|---|---|---|
| new / old (diff) | 0.217701 / 0.018006 (0.199695) | 0.384770 / 0.000490 (0.384280) | 0.000437 / 0.000200 (0.000237) | 0.000061 / 0.000054 (0.000006) |

### Benchmark: benchmark_indices_mapping.json

| metric | select | shard | shuffle | sort | train_test_split |
|--------|---|---|---|---|---|
| new / old (diff) | 0.024952 / 0.037411 (-0.012459) | 0.098728 / 0.014526 (0.084202) | 0.106324 / 0.176557 (-0.070233) | 0.155484 / 0.737135 (-0.581651) | 0.109503 / 0.296338 (-0.186836) |

### Benchmark: benchmark_iterating.json

| metric | read 5000 | read 50000 | read_batch 50000 10 | read_batch 50000 100 | read_batch 50000 1000 | read_formatted numpy 5000 | read_formatted pandas 5000 | read_formatted tensorflow 5000 | read_formatted torch 5000 | read_formatted_batch numpy 5000 10 | read_formatted_batch numpy 5000 1000 | shuffled read 5000 | shuffled read 50000 | shuffled read_batch 50000 10 | shuffled read_batch 50000 100 | shuffled read_batch 50000 1000 | shuffled read_formatted numpy 5000 | shuffled read_formatted_batch numpy 5000 10 | shuffled read_formatted_batch numpy 5000 1000 |
|--------|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| new / old (diff) | 0.450639 / 0.215209 (0.235430) | 4.523110 / 2.077655 (2.445455) | 2.224810 / 1.504120 (0.720690) | 2.119516 / 1.541195 (0.578321) | 2.225192 / 1.468490 (0.756702) | 0.695397 / 4.584777 (-3.889380) | 3.433559 / 3.745712 (-0.312153) | 2.633127 / 5.269862 (-2.636735) | 1.448471 / 4.565676 (-3.117206) | 0.082262 / 0.424275 (-0.342013) | 0.012246 / 0.007607 (0.004639) | 0.561243 / 0.226044 (0.335199) | 5.652711 / 2.268929 (3.383782) | 2.689771 / 55.444624 (-52.754853) | 2.359512 / 6.876477 (-4.516965) | 2.471098 / 2.142072 (0.329026) | 0.802955 / 4.805227 (-4.002272) | 0.151142 / 6.500664 (-6.349522) | 0.067494 / 0.075469 (-0.007975) |

### Benchmark: benchmark_map_filter.json

| metric | filter | map fast-tokenizer batched | map identity | map identity batched | map no-op batched | map no-op batched numpy | map no-op batched pandas | map no-op batched pytorch | map no-op batched tensorflow |
|--------|---|---|---|---|---|---|---|---|---|
| new / old (diff) | 1.306879 / 1.841788 (-0.534909) | 14.030775 / 8.074308 (5.956467) | 12.917790 / 10.191392 (2.726398) | 0.141269 / 0.680424 (-0.539155) | 0.016264 / 0.534201 (-0.517937) | 0.411957 / 0.579283 (-0.167326) | 0.393235 / 0.434364 (-0.041129) | 0.505144 / 0.540337 (-0.035193) | 0.590660 / 1.386936 (-0.796276) |

</details>
</details>

![](https://cml.dev/watermark.png#7790ebd7072eafff755fb575b392f3efa74069e4 "CML watermark")

2023-05-17T14:07:31Z
https://github.com/huggingface/datasets/pull/5770#issuecomment-1551466014
https://api.github.com/repos/huggingface/datasets/issues/5770
IC_kwDODunzps5ceX4e
https://api.github.com/repos/huggingface/datasets/issues/comments/1551466014/reactions
2023-05-17T14:07:31Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1551466014
https://avatars.githubusercontent.com/in/15368?v=4
https://api.github.com/users/github-actions%5Bbot%5D/events{/privacy}
https://api.github.com/users/github-actions%5Bbot%5D/followers
https://api.github.com/users/github-actions%5Bbot%5D/following{/other_user}
https://api.github.com/users/github-actions%5Bbot%5D/gists{/gist_id}
https://github.com/apps/github-actions
github-actions[bot]
MDM6Qm90NDE4OTgyODI=
https://api.github.com/users/github-actions%5Bbot%5D/orgs
https://api.github.com/users/github-actions%5Bbot%5D/received_events
https://api.github.com/users/github-actions%5Bbot%5D/repos
https://api.github.com/users/github-actions%5Bbot%5D/starred{/owner}{/repo}
https://api.github.com/users/github-actions%5Bbot%5D/subscriptions
Bot
https://api.github.com/users/github-actions%5Bbot%5D
public
Follow-up from https://github.com/huggingface/datasets/pull/5701

Related issue: https://github.com/huggingface/datasets/issues/5678