forked from marsupialtail/quokka
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sparrow.yaml
37 lines (36 loc) · 1.23 KB
/
sparrow.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
image:
- melezhik/sparrow:debian
tasks:
-
name: example
default: true
language: Python
code: |
from pyquokka.df import QuokkaContext
qc = QuokkaContext()
lineitem = qc.read_csv("lineitem.tbl.named", sep="|", has_header=True)
d = lineitem.filter("l_shipdate <= date '1998-12-01' - interval '90' day")
d = d.with_column("disc_price", lambda x: x["l_extendedprice"] * (1 - x["l_discount"]), required_columns ={"l_extendedprice", "l_discount"})
d = d.with_column("charge", lambda x: x["l_extendedprice"] * (1 - x["l_discount"]) * (1 + x["l_tax"]), required_columns={"l_extendedprice", "l_discount", "l_tax"})
f = d.groupby(["l_returnflag", "l_linestatus"], orderby=["l_returnflag","l_linestatus"]).agg({"l_quantity":["sum","avg"], "l_extendedprice":["sum","avg"], "disc_price":"sum", "charge":"sum", "l_discount":"avg","*":"count"})
print(f.collect())
depends:
-
name: install
-
name: install
language: Bash
code: |
set -e
cd source
pip3 install -e .
depends:
-
name: install-python
-
name: install-python
language: Bash
code: |
set -e
sudo apt-get install -y python3-pip
sudo apt-get install -y redis-server