fsspec / fsspec/filesystem_spec
read an HDFS file by line failed when the open_mode is "rb"
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 1.4k
- Forks
- 490
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 38
Description
Hi there,
I found some problems when I read an HDFS file by line when the open_mode is "rb". It works fine when the open_mode is "r" or the file is located locally.
some snippets:
import fsspec
hdfs_file_path = "hdfs://xxxxxx"
with fsspec.open(hdfs_file_path, "rb") as f:
# raise UnspportedOperation
f.readline()
Error logs:
/opt/conda/lib/python3.7/site-packages/pyarrow/io.pxi in pyarrow.lib.NativeFile.readline()
UnsupportedOperation:
Envs:
System: Ubuntu 18.04
fsspec: 2021.10.1
pyarrow: 6.0.0
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the HDFS example through fsspec.open with open_mode "rb", then trace the HDFS-backed file object to the pyarrow NativeFile.readline() call shown in the error. Compare this behavior with local files and mode "r"; done means line reads work for binary HDFS handles without raising UnsupportedOperation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- distributed-systems
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100