本文介紹了在 Hadoop Streaming 中生成單獨的輸出文件的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!
問題描述
只使用一個映射器(一個 Python 腳本)而不使用 reducer,我怎樣才能為每一行輸出輸出一個以鍵作為文件名的單獨文件,而不是輸出長文件?
Using only a mapper (a Python script) and no reducer, how can I output a separate file with the key as the filename, for each line of output, rather than having long files of output?
推薦答案
您可以使用 python 文件函數寫入本地文件系統上的文本文件,或者如果您想使用 HDFS,請使用 Thrift API.
You can either write to a text file on the local filesystem using python file functions or if you want to use HDFS use the Thrift API.
這篇關于在 Hadoop Streaming 中生成單獨的輸出文件的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!
【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!