odps词频统计
来源:互联网 发布:淘宝马学武白玉城真假 编辑:程序博客网 时间:2024/05/16 14:27
1、搭建maxcompute studio
一、编写udtf
2、在项目下面选择script新建文件:new->maxcomput python->python udtf ,然后编写文本spilt:
from odps.udf import annotatefrom odps.udf import BaseUDTF@annotate('string -> string')class my_first_udtf(BaseUDTF): def process(self, arg): props = arg.split(' ') for p in props: self.forward(p)
然后运行一下,本地调试,可以查看结果。
3、提交udtf,并注册函数:打开该python源码,在定义的类my_first_udtf中,右键-》deploy to server,然后填写一下function name即可上传,并且注册函数function name
4、sql调用函数 测试结果:
create table if not exists chenmo_word_split_tabel1(word string ) lifecycle 1;insert overwrite table chenmo_word_split_tabel1 select my_first_udtf(word) as word from chenmo_wc_in;
二、编写udaf进行聚合统计
阅读全文
0 0
- odps词频统计
- 词频统计
- 词频统计
- 词频统计
- 词频统计
- 词频统计
- 词频统计
- 词频统计
- 词频统计
- 词频统计
- 词频统计
- 词频统计
- 统计词频
- 词频统计
- 词频统计
- 分词统计词频
- 词频统计系统
- python 统计词频
- Android Camera 正方形预览(二)
- [数论] 51nod 1365 Fib(N) mod Fib(K)
- python练习----基本流程控制
- JQuery lhgdialog的使用
- org.apache.commons.io.FileUtils文件操作解析
- odps词频统计
- jquery easyui combobox required=true设置
- 浅谈语音测试方案(一)
- 长沙智慧滨江项目以BIM技术打造中部地区“曼哈顿”
- Ubuntu安装Adobe flash player
- iOS 获取设备唯一标识符
- PAT 甲级 1044. Shopping in Mars (25)
- c# 选项卡
- css3 阴影、文字旋转、圆角、投影