Getting next item from IterableDataset took forever.
COLLABORATOR
Hi! It can take some time to iterate over Parquet files as big as yours, convert the samples to Python, and find the first one that matches a filter predicate before yielding it...
2023-04-05T18:13:35Z
https://github.com/huggingface/datasets/issues/5705#issuecomment-1497915897
https://api.github.com/repos/huggingface/datasets/issues/5705
IC_kwDODunzps5ZSGH5
https://api.github.com/repos/huggingface/datasets/issues/comments/1497915897/reactions
2023-04-05T18:13:35Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1497915897
https://avatars.githubusercontent.com/u/47462742?v=4
https://api.github.com/users/mariosasko/events{/privacy}
https://api.github.com/users/mariosasko/followers
https://api.github.com/users/mariosasko/following{/other_user}
https://api.github.com/users/mariosasko/gists{/gist_id}
https://github.com/mariosasko
mariosasko
MDQ6VXNlcjQ3NDYyNzQy
https://api.github.com/users/mariosasko/orgs
https://api.github.com/users/mariosasko/received_events
https://api.github.com/users/mariosasko/repos
https://api.github.com/users/mariosasko/starred{/owner}{/repo}
https://api.github.com/users/mariosasko/subscriptions
User
https://api.github.com/users/mariosasko
public
NONE
Thanks @mariosasko, I figured it was the filter operation. I'm closing this issue because it is not a bug, it is the expected beheaviour.
2023-04-05T23:35:41Z
https://github.com/huggingface/datasets/issues/5705#issuecomment-1498284810
https://api.github.com/repos/huggingface/datasets/issues/5705
IC_kwDODunzps5ZTgMK
https://api.github.com/repos/huggingface/datasets/issues/comments/1498284810/reactions
2023-04-05T23:35:41Z
https://api.github.com/repos/huggingface/datasets/issues/comments/1498284810
https://avatars.githubusercontent.com/u/16588434?v=4
https://api.github.com/users/HongtaoYang/events{/privacy}
https://api.github.com/users/HongtaoYang/followers
https://api.github.com/users/HongtaoYang/following{/other_user}
https://api.github.com/users/HongtaoYang/gists{/gist_id}
https://github.com/HongtaoYang
HongtaoYang
MDQ6VXNlcjE2NTg4NDM0
https://api.github.com/users/HongtaoYang/orgs
https://api.github.com/users/HongtaoYang/received_events
https://api.github.com/users/HongtaoYang/repos
https://api.github.com/users/HongtaoYang/starred{/owner}{/repo}
https://api.github.com/users/HongtaoYang/subscriptions
User
https://api.github.com/users/HongtaoYang
public
### Describe the bug

I have a large dataset, about 500GB. The format of the dataset is parquet. 

I then load the dataset and try to get the first item
```python
def get_one_item():
    dataset = load_dataset("path/to/datafiles", split="train", cache_dir=".", streaming=True)
    dataset = dataset.filter(lambda example: example['text'].startswith('Ar'))
    print(next(iter(dataset)))
```

However, this function never finish. I waited ~10mins, the function was still running so I killed the process. I'm now using `line_profiler` to profile how long it would take to return one item. I'll be patient and wait for as long as it needs. 

I suspect the filter operation is the reason why it took so long. Can I get some possible reasons behind this?

### Steps to reproduce the bug

Unfortunately without my data files, there is no way to reproduce this bug.

### Expected behavior

With `IteralbeDataset`, I expect the first item to be returned instantly.

### Environment info

- datasets version: 2.11.0 
- python: 3.7.12