使用python从HDFS获取镶木地板文件

问题描述 投票:0回答:1

我用windows单集群构建了自己的hdfs,从这个link

得到了参考

然后我已经输入了我的镶木地板文件,但我无法从其他计算机读取该文件。

这是我的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 获取镶木地板文件吗?

python hadoop parquet
1个回答
0
投票

你尝试过熊猫的

read_parquet()
吗?

df = pd.read_parquet('hdfs://10.35.105.35:9820/tampo/oee_tampo.parquet')
df
© www.soinside.com 2019 - 2024. All rights reserved.