12345678910111213141516171819202122232425262728293031 |
- import argparse
- import sys
- import gzip
- from hdfs import InsecureClient
- client = InsecureClient("http://master-1-1.c-7f31a3eea195cb73.cn-hangzhou.emr.aliyuncs.com:9870")
- def read_predict(hdfs_path):
- for file in client.list(hdfs_path):
- with client.read(file, encoding="utf-8") as reador:
- with gzip.GzipFile(fileobj=reador, mode="rb") as gz_file:
- content = gz_file.read().decode("utf-8")
- print(f"Content of {file}:\n {content}")
- def _main():
- read_predict("/dw/recommend/model/34_ad_predict_data/20241004_351_0927_1003_1000")
- if __name__ == '__main__':
-
-
-
-
-
-
-
-
- _main()
|