从1000张表导出数据并在hive中去重

来源:互联网 发布:杜月笙 知乎 编辑:程序博客网 时间:2024/04/30 16:44

第一步:建立shell脚本

#!/bin/sh
for i in $(seq 0 999);do
        mysql -hhh-ml-oauth-db00.bj -utj_0420_0423 -p48474e200254b663f18888365f7f5758 passport_oauth2 -e "select user_id from oauth_user_client_relation_${i}" >> t.txt
done


第二部:放入hdfs进行去重

./hive fs -put txt文档的路径 testfile的路径

0 0
原创粉丝点击