hadoop 使用Python从HDFS获取parquet文件

wb1gzix0  于 9个月前  发布在  Hadoop
关注(0)|答案(1)|浏览(70)

我用windows单集群构建了自己的hdfs,参考了这个link
然后我已经输入了我的Parquet文件,但我不能从其他计算机读取文件。
这是我的Python代码

import pyarrow as pa
import pyarrow.parquet as pq

hdfs_path = "hdfs://10.35.105.35:9820/tampo/oee_tampo.parquet"

fs = pa.hdfs.connect()

table = pq.read_table(hdfs_path, filesystem=fs)

import pandas as pd
df = table.to_pandas()

fs.close()

误差

1522     # pipe will not close when the child process exits and the
   1523     # ReadFile will hang.
   1524     self._close_pipe_fds(p2cread, p2cwrite,
   1525                          c2pread, c2pwrite,
   1526                          errread, errwrite)

FileNotFoundError: [WinError 2] The system cannot find the file specified

有谁能解决这个问题,或者有其他方法可以从hdfs中获取parquet文件吗?

ygya80vv

ygya80vv1#

你试过Pandas的read_parquet()吗?

df = pd.read_parquet('hdfs://10.35.105.35:9820/tampo/oee_tampo.parquet')
df

相关问题