123456789101112131415161718192021222324 |
- /* syntax version 1 */
- /* postgres can not */
- USE plato;
- $udf = YQL::@@
- (lambda '(key stream)
- (PartitionByKey stream
- (lambda '(item) (Way item))
- (Void)
- (Void)
- (lambda '(listOfPairs)
- (FlatMap listOfPairs
- (lambda '(pair) (Just (AsStruct '('key key) '('src (Nth pair '0)) '('cnt (Length (ForwardList (Nth pair '1)))))))
- )
- )
- )
- )
- @@;
- $src = (select * from plato.Input where key > "200");
- $r = (REDUCE Input, (select * from Input where key > "100"), $src ON key USING $udf(TableRow()));
- SELECT key, src, cnt FROM $r ORDER BY key, src, cnt;
|