-
Notifications
You must be signed in to change notification settings - Fork 19
Example programs
billhowe edited this page Jun 11, 2015
·
6 revisions
Does not work at the moment, because we cannot sort.
apply Counter(value) {
[0 AS c];
[c + 1 AS c];
c;
};
AP = scan(AcquisitionsPrice);
NUM = [from AP emit count(price)];
SAP = [from AP order by price emit *]; -- order by does not yet work
Result = [from SAP emit Counter(price)/*NUM AS percentile];
store (Result, AcquisitionsCDF);Acq = scan(Acquisitions);
Inv = scan(Investments);
Funding = [from Inv
emit company_permalink
, sum(raised_amount_usd) as sum_raised_amount_usd];
Joined = [from Acq, Funding
where price_amount > 0 and Funding.company_permalink == Acq.company_permalink
emit price_amount, price_currency_code, sum_raised_amount_usd];
store (Joined, AcquisitionsProfit);