Skip to content

Commit 3da559e

Browse files
authored
chore: add groupby benchmark q10, update q8 (#809)
* chore: add groupby benchmark q10, update q8 * update code
1 parent 014765c commit 3da559e

File tree

2 files changed

+17
-0
lines changed
  • scripts/benchmark/db-benchmark/groupby/G1_1e9_1e2_5_0

2 files changed

+17
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Contains code from https://github.com/duckdblabs/db-benchmark/blob/master/pandas/groupby-pandas.py
2+
3+
import bigframes.pandas as bpd
4+
5+
print("Groupby benchmark 10: sum v3 count by id1:id6")
6+
7+
x = bpd.read_gbq("bigframes-dev-perf.dbbenchmark.G1_1e9_1e2_5_0")
8+
9+
ans = x.groupby(
10+
["id1", "id2", "id3", "id4", "id5", "id6"], as_index=False, dropna=False
11+
).agg({"v3": "sum", "v1": "size"})
12+
print(ans.shape)
13+
chk = [ans["v3"].sum(), ans["v1"].sum()]
14+
print(chk)
15+
16+
bpd.reset_session()

scripts/benchmark/db-benchmark/groupby/G1_1e9_1e2_5_0/q8.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
.groupby("id6", as_index=False, dropna=False)
1313
.head(2)
1414
)
15+
ans = ans.reset_index(drop=True)
1516
print(ans.shape)
1617
chk = [ans["v3"].sum()]
1718
print(chk)

0 commit comments

Comments
 (0)