Skip to content

Commit

Permalink
chore(decompile): update snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
gforsyth committed Aug 7, 2024
1 parent 538fb3f commit 905401f
Show file tree
Hide file tree
Showing 12 changed files with 47 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
name="employee",
schema={"first_name": "string", "last_name": "string", "id": "int64"},
)
lit = ibis.literal(True)
call = ibis.table(
name="call",
schema={
Expand All @@ -19,8 +20,8 @@
name="call_outcome", schema={"outcome_text": "string", "id": "int64"}
)
joinchain = (
employee.inner_join(call, employee.id == call.employee_id)
.inner_join(call_outcome, call.call_outcome_id == call_outcome.id)
employee.inner_join(call, [(employee.id == call.employee_id), lit])
.inner_join(call_outcome, [(call.call_outcome_id == call_outcome.id), lit])
.select(
employee.first_name,
employee.last_name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
"call_attempts": "int64",
},
)
joinchain = employee.left_join(call, employee.id == call.employee_id).select(
joinchain = employee.left_join(
call, [(employee.id == call.employee_id), ibis.literal(True)]
).select(
employee.first_name,
employee.last_name,
employee.id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
"call_attempts": "int64",
},
)
joinchain = employee.inner_join(call, employee.id == call.employee_id).select(
joinchain = employee.inner_join(
call, [(employee.id == call.employee_id), ibis.literal(True)]
).select(
employee.first_name,
employee.last_name,
employee.id,
Expand All @@ -25,7 +27,7 @@
call.call_outcome_id,
call.call_attempts,
)
f = joinchain.filter(joinchain.id < 5)
f = joinchain.filter((joinchain.id < 5))
s = f.order_by(f.id.desc())

result = s.select(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
"call_attempts": "int64",
},
)
joinchain = employee.left_join(call, employee.id == call.employee_id).select(
joinchain = employee.left_join(
call, [(employee.id == call.employee_id), ibis.literal(True)]
).select(
employee.first_name,
employee.last_name,
employee.id,
Expand All @@ -25,7 +27,7 @@
call.call_outcome_id,
call.call_attempts,
)
f = joinchain.filter(joinchain.id < 5)
f = joinchain.filter((joinchain.id < 5))
s = f.order_by(f.id.desc())

result = s.select(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
"call_attempts": "int64",
},
)
joinchain = employee.right_join(call, employee.id == call.employee_id).select(
joinchain = employee.right_join(
call, [(employee.id == call.employee_id), ibis.literal(True)]
).select(
employee.first_name,
employee.last_name,
employee.id,
Expand All @@ -25,7 +27,7 @@
call.call_outcome_id,
call.call_attempts,
)
f = joinchain.filter(joinchain.id < 5)
f = joinchain.filter((joinchain.id < 5))
s = f.order_by(f.id.desc())

result = s.select(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
name="employee",
schema={"first_name": "string", "last_name": "string", "id": "int64"},
)
f = employee.filter(employee.id < 5)
f = employee.filter((employee.id < 5))
s = f.order_by(f.id.desc())

result = s.select(s.first_name, s.last_name, s.id, s.first_name.name("first"))
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
"call_attempts": "int64",
},
)
joinchain = employee.left_join(call, employee.id == call.employee_id).select(
joinchain = employee.left_join(
call, [(employee.id == call.employee_id), ibis.literal(True)]
).select(
employee.first_name,
employee.last_name,
employee.id,
Expand All @@ -25,7 +27,7 @@
call.call_outcome_id,
call.call_attempts,
)
f = joinchain.filter(joinchain.id < 5)
f = joinchain.filter((joinchain.id < 5))
s = f.order_by(f.id.desc())

result = s.select(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
name="employee",
schema={"first_name": "string", "last_name": "string", "id": "int64"},
)
lit = ibis.literal(True)
call = ibis.table(
name="call",
schema={
Expand All @@ -20,8 +21,8 @@
)

result = (
employee.inner_join(call, employee.id == call.employee_id)
.inner_join(call_outcome, call.call_outcome_id == call_outcome.id)
employee.inner_join(call, [(employee.id == call.employee_id), lit])
.inner_join(call_outcome, [(call.call_outcome_id == call_outcome.id), lit])
.select(
employee.first_name,
employee.last_name,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
agg = call.aggregate([call.call_attempts.mean().name("mean")])

result = call.inner_join(
agg, [agg.mean < call.call_attempts, ibis.literal(True)]
agg, [(agg.mean < call.call_attempts), ibis.literal(True)]
).select(
call.start_time,
call.end_time,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
schema={"first_name": "string", "last_name": "string", "id": "int64"},
)

result = employee.aggregate([employee.first_name.count().name("_col_0")])
result = employee.aggregate([employee.count().name("_col_0")])
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from __future__ import annotations

import ibis


lineitem = ibis.table(
name="lineitem",
schema={
Expand All @@ -24,14 +23,14 @@
},
)
lit = ibis.literal(1)
f = lineitem.filter(lineitem.l_shipdate <= ibis.literal("1998-09-02").cast("date"))
multiply = f.l_extendedprice * (lit - f.l_discount)
f = lineitem.filter((lineitem.l_shipdate <= ibis.literal("1998-09-02").cast("date")))
multiply = f.l_extendedprice * ((lit - f.l_discount))
agg = f.aggregate(
[
f.l_quantity.sum().name("sum_qty"),
f.l_extendedprice.sum().name("sum_base_price"),
multiply.sum().name("sum_disc_price"),
((multiply) * (lit + f.l_tax)).sum().name("sum_charge"),
((multiply) * ((lit + f.l_tax))).sum().name("sum_charge"),
f.l_quantity.mean().name("avg_qty"),
f.l_extendedprice.mean().name("avg_price"),
f.l_discount.mean().name("avg_disc"),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from __future__ import annotations

import ibis


customer = ibis.table(
name="customer",
schema={
Expand Down Expand Up @@ -53,8 +52,18 @@
)
cast = ibis.literal("1995-03-15").cast("date")
joinchain = (
customer.inner_join(orders, [lit, (orders.o_orderdate.cast("timestamp") < cast)])
.inner_join(lineitem, [lit, (lineitem.l_shipdate > cast)])
customer.inner_join(
orders,
[
(customer.c_custkey == orders.o_custkey),
lit,
(orders.o_orderdate.cast("timestamp") < cast),
],
)
.inner_join(
lineitem,
[(orders.o_orderkey == lineitem.l_orderkey), lit, (lineitem.l_shipdate > cast)],
)
.select(
customer.c_custkey,
customer.c_name,
Expand Down Expand Up @@ -91,9 +100,9 @@
lineitem.l_comment,
)
)
f = joinchain.filter(joinchain.c_mktsegment == "BUILDING")
f = joinchain.filter((joinchain.c_mktsegment == "BUILDING"))
agg = f.aggregate(
[(f.l_extendedprice * (1 - f.l_discount)).sum().name("revenue")],
[(f.l_extendedprice * ((1 - f.l_discount))).sum().name("revenue")],
by=[f.l_orderkey, f.o_orderdate, f.o_shippriority],
)
s = agg.order_by(agg.revenue.desc(), agg.o_orderdate.asc())
Expand Down

0 comments on commit 905401f

Please sign in to comment.