hive 使用python脚本
来源:互联网 发布:小白网络技术论坛 编辑:程序博客网 时间:2024/05/19 20:59
首先,相关MapReduce的操作请看博客 http://blog.csdn.net/longshenlmj/article/details/24380041
pyhton 脚本其实很快就写完了。 但是,如何测试,add file 却是把 我难道了。
import sysimport reimport math#select score,down_count,collected_count,comment_count,view_count,product_code,product_name,year,month,day from zshtest#for line in sys.stdin: (score,down_count,collected_count,comment_count,view_count,product_code,product_name,year,month,day) = line.strip().split() if (view_count > 0 ): rank = score+(down_count+collected_count+comment_count)/view_count else: rank = 0 print "%s\t%s\t%s\t%s\t%s\t%s" % (product_code,product_name,year,month,day,rank)
我这个脚本难道要直接放到大数据的服务器上,add file 其实应用的路径是hive的默认路径?
路径没有错误 只是调用方法错了, 为什么所有的资料都是错误的方式 , 难道他们没报错
add file ./wanyi/t_product.py ;
from zshtest
select transform(score)
using ' python t_product.py'
as rank,score
我少了一个 启用 python 的命令 , 大家都是 using ‘t_product.py’ 这样的模式 , 难道都不报错 ?
困扰了我两天 啊!
阅读全文
0 0
- hive 使用python脚本
- Hive使用脚本加载数据
- hive 0.8运行python脚本问题
- hive中用python脚本做小表的关联
- hive使用python脚本导致java.io.IOException: Broken pipe异常退出
- 使用Python脚本从Hive中取数据计算后加载到Mysql示例
- #hive#HIVE中使用python实现UDF
- python和hive结合使用
- 使用python客户端访问hive
- hive 中使用shell/python
- 使用shell脚本执行hive、sqoop命令
- Hive的使用之脚本文件
- hive 脚本
- Hive 脚本
- Hive脚本
- hive脚本
- IIS 使用 Python 脚本
- ArcGIS Python脚本使用
- app:buildInfoDebugLoader
- 深度卷积网络图像风格转移(二)架构分析
- java-文件上传到读取文件内容
- 微信小程序开发—(十六)video视频播放
- spring+mybatis 多线程访问数据
- hive 使用python脚本
- sql别名,只有select查询语句有sql别名。
- com.android.ide.common.process.ProcessException: Failed to execute aapt
- XCode中 instruments 工具使用
- Zookeeper的安装和配置(转载)
- yolo v2 Ubuntu14.04 调整权重与分类需要调整的参数
- [Mysql] 数据库连接:Establishing SSL connection without server's identity verification is not recommended.
- [LeetCode]118. Pascal's Triangle
- 摆脱码农,走向管理,细节养成习惯