deep826 opened a new issue, #41777:
URL: https://github.com/apache/arrow/issues/41777

   ### Describe the usage question you have. Please include as many useful 
details as  possible.
   
   
   hi, I use pyarrow.fs.HadoopFileSystem client to interact with hdfs. And I 
write some bytes to a file in hdfs, then download it to local filesystem. I 
read the file using python native api: read, but the result is false. When I 
use pyarrow hdfs client to read the file in hdfs, the result is right. I'm 
confused..... here are some sudo code snippet.
   `a = 1000 `
   `b = 64`
   `with hdfs_client.open_output_stream(path) as f:`
   `    f.write(a.to_bytes(8, sys.byteorder))`
   `    f.write(b.to_bytes(4, sys.byteorder))`
   here, i write 12 bytes to file: path, then i download  it from hdfs to 
local_path and read these bytes as follows:
   `with open(local_path, 'rb') as f:`
   `    bs = f.read(12)`
   `    a = int.from_bytes(bs[0:8], sys.byteorder)`
   `    b = int.from_bytes(bs[8:12], sys.byteorder)`
   `    print(f"a: {a}, b: {b}")`
   The print result is: a: 559903, b: 3158573824, the expected values should 
be: a: 1000, b: 64.
   So What's the problem.....
   
   ### Component(s)
   
   C, C++, Python


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@arrow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to