Apache DataFu分两部分,本文介绍的是其Pig UDF的部分。代码在Github上开源。
DataFu里面是一些Pig的UDF,主要包括这些方面的函数:
bags、geo、hash、linkanalysis、random、sampling、sessions、sets、stats、urls
每方面都对应一个package。
我把所有的函数源码都浏览了一遍。其实本身对这些UDF的使用,官方的文档上都有介绍,而且源码的注释里也些的很清晰。所以使用本身是很简单的。
从实现角度看,继承自Pig Ev...
分类:
其他好文 时间:
2014-05-09 01:14:25
阅读次数:
436
先看看列表里的__setslice__方法函数的帮助文档
help(list.__setslice__)
帮助文档如下所示:
__setslice__(...)
x.__setslice__(i, j, y) x[i:j]=y
Use of negative indices is not supported.
从帮助文档可以看出这个方法函数可...
分类:
编程语言 时间:
2014-05-09 01:01:56
阅读次数:
326
The gray code is a binary numeral system where two successive values differ in only one bit.
Given a non-negative integer n representing the total number of bits in the code, print the sequence of gr...
分类:
其他好文 时间:
2014-05-07 06:10:17
阅读次数:
370
1、到今天完成39题,还需要不停的加油。今天再分析下装雨水这道题Given n
non-negative integers representing an elevation map where the width of each bar
is 1, compute how much water i...
分类:
移动开发 时间:
2014-05-06 14:08:48
阅读次数:
490
Given an array of non-negative integers, you
are initially positioned at the first index of the array.Each element in the
array represents your maximu...
分类:
其他好文 时间:
2014-05-05 10:05:58
阅读次数:
300
Given a non-negative number represented as an array
of digits, plus one to the number.The digits are stored such that the most
significant digit is at...
分类:
其他好文 时间:
2014-05-04 19:46:18
阅读次数:
372
You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a link...
分类:
其他好文 时间:
2014-05-01 22:08:19
阅读次数:
366
You are given two linked lists representing two
non-negative numbers. The digits are stored in reverse order and each of their
nodes contain a single ...
分类:
其他好文 时间:
2014-05-01 20:18:54
阅读次数:
425
Determine whether an integer is a palindrome.
Do this without extra space.Some hints:Could negative integers be palindromes?
(ie, -1)If you are thinki...
分类:
其他好文 时间:
2014-05-01 19:48:19
阅读次数:
344
Given n non-negative integers a1, a2,
..., an, where each represents a point at coordinate (i, ai). n vertical
lines are drawn such that the two endpoints of line i is at (i, ai) and (i,
0). Fin...
分类:
其他好文 时间:
2014-04-29 13:15:21
阅读次数:
415