Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在寻找不同的选项,通过这些选项,我可以使用 python 将数据直接写入 hdfs,而无需存储在本地节点上,然后使用 copyfromlocal。
我想使用类似于本地文件的 hdfs 文件,并使用以行作为参数的 write 方法,如下所示:
hdfs_file = hdfs.create("file_tmp") hdfs_file.write("Hello world\n")
是否存在类似于上述用例的东西?
我不确定 python hdfs 库,但您始终可以通过 hadoop fs put 命令进行流式传输,并使用“-”作为源文件名表示从标准输入复制:
hadoop fs -put - /path/to/file/in/hdfs.txt