mirror of
https://github.com/Kaelio/ktx.git
synced 2026-06-16 08:25:14 +02:00
Initial open-source release
This commit is contained in:
commit
1a42152e6f
1199 changed files with 257054 additions and 0 deletions
27
python/klo-sl/sources/tpch/customer.yaml
Normal file
27
python/klo-sl/sources/tpch/customer.yaml
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
name: customer
|
||||
table: public.customer
|
||||
grain: [c_custkey]
|
||||
columns:
|
||||
- name: c_custkey
|
||||
type: number
|
||||
- name: c_name
|
||||
type: string
|
||||
- name: c_address
|
||||
type: string
|
||||
- name: c_nationkey
|
||||
type: number
|
||||
- name: c_phone
|
||||
type: string
|
||||
- name: c_acctbal
|
||||
type: number
|
||||
- name: c_mktsegment
|
||||
type: string
|
||||
- name: c_comment
|
||||
type: string
|
||||
joins:
|
||||
- to: nation
|
||||
"on": c_nationkey = nation.n_nationkey
|
||||
relationship: many_to_one
|
||||
measures:
|
||||
- name: customer_count
|
||||
expr: count(c_custkey)
|
||||
69
python/klo-sl/sources/tpch/lineitem.yaml
Normal file
69
python/klo-sl/sources/tpch/lineitem.yaml
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
name: lineitem
|
||||
table: public.lineitem
|
||||
grain: [l_orderkey, l_linenumber]
|
||||
columns:
|
||||
- name: l_orderkey
|
||||
type: number
|
||||
- name: l_partkey
|
||||
type: number
|
||||
- name: l_suppkey
|
||||
type: number
|
||||
- name: l_linenumber
|
||||
type: number
|
||||
- name: l_quantity
|
||||
type: number
|
||||
- name: l_extendedprice
|
||||
type: number
|
||||
- name: l_discount
|
||||
type: number
|
||||
- name: l_tax
|
||||
type: number
|
||||
- name: l_returnflag
|
||||
type: string
|
||||
- name: l_linestatus
|
||||
type: string
|
||||
- name: l_shipdate
|
||||
type: time
|
||||
role: time
|
||||
- name: l_commitdate
|
||||
type: time
|
||||
- name: l_receiptdate
|
||||
type: time
|
||||
- name: l_shipinstruct
|
||||
type: string
|
||||
- name: l_shipmode
|
||||
type: string
|
||||
- name: l_comment
|
||||
type: string
|
||||
joins:
|
||||
- to: orders
|
||||
"on": l_orderkey = orders.o_orderkey
|
||||
relationship: many_to_one
|
||||
- to: part
|
||||
"on": l_partkey = part.p_partkey
|
||||
relationship: many_to_one
|
||||
- to: supplier
|
||||
"on": l_suppkey = supplier.s_suppkey
|
||||
relationship: many_to_one
|
||||
measures:
|
||||
- name: revenue
|
||||
expr: sum(l_extendedprice * (1 - l_discount))
|
||||
description: "Net revenue (TPC-H Q1 pricing)"
|
||||
- name: charge
|
||||
expr: sum(l_extendedprice * (1 - l_discount) * (1 + l_tax))
|
||||
description: "Charge including tax"
|
||||
- name: total_quantity
|
||||
expr: sum(l_quantity)
|
||||
- name: avg_quantity
|
||||
expr: avg(l_quantity)
|
||||
- name: avg_price
|
||||
expr: avg(l_extendedprice)
|
||||
- name: avg_discount
|
||||
expr: avg(l_discount)
|
||||
- name: line_count
|
||||
expr: count(l_orderkey)
|
||||
description: "Count of line items"
|
||||
- name: returned_revenue
|
||||
expr: sum(l_extendedprice * (1 - l_discount))
|
||||
filter: "l_returnflag = 'R'"
|
||||
description: "Revenue from returned items"
|
||||
16
python/klo-sl/sources/tpch/nation.yaml
Normal file
16
python/klo-sl/sources/tpch/nation.yaml
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
name: nation
|
||||
table: public.nation
|
||||
grain: [n_nationkey]
|
||||
columns:
|
||||
- name: n_nationkey
|
||||
type: number
|
||||
- name: n_name
|
||||
type: string
|
||||
- name: n_regionkey
|
||||
type: number
|
||||
- name: n_comment
|
||||
type: string
|
||||
joins:
|
||||
- to: region
|
||||
"on": n_regionkey = region.r_regionkey
|
||||
relationship: many_to_one
|
||||
36
python/klo-sl/sources/tpch/orders.yaml
Normal file
36
python/klo-sl/sources/tpch/orders.yaml
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
name: orders
|
||||
table: public.orders
|
||||
grain: [o_orderkey]
|
||||
columns:
|
||||
- name: o_orderkey
|
||||
type: number
|
||||
- name: o_custkey
|
||||
type: number
|
||||
- name: o_orderstatus
|
||||
type: string
|
||||
- name: o_totalprice
|
||||
type: number
|
||||
- name: o_orderdate
|
||||
type: time
|
||||
role: time
|
||||
- name: o_orderpriority
|
||||
type: string
|
||||
- name: o_clerk
|
||||
type: string
|
||||
- name: o_shippriority
|
||||
type: number
|
||||
- name: o_comment
|
||||
type: string
|
||||
joins:
|
||||
- to: customer
|
||||
"on": o_custkey = customer.c_custkey
|
||||
relationship: many_to_one
|
||||
measures:
|
||||
- name: order_count
|
||||
expr: count(o_orderkey)
|
||||
- name: total_price
|
||||
expr: sum(o_totalprice)
|
||||
description: "Total order value"
|
||||
- name: avg_order_value
|
||||
expr: avg(o_totalprice)
|
||||
description: "Average order value"
|
||||
22
python/klo-sl/sources/tpch/part.yaml
Normal file
22
python/klo-sl/sources/tpch/part.yaml
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
name: part
|
||||
table: public.part
|
||||
grain: [p_partkey]
|
||||
columns:
|
||||
- name: p_partkey
|
||||
type: number
|
||||
- name: p_name
|
||||
type: string
|
||||
- name: p_mfgr
|
||||
type: string
|
||||
- name: p_brand
|
||||
type: string
|
||||
- name: p_type
|
||||
type: string
|
||||
- name: p_size
|
||||
type: number
|
||||
- name: p_container
|
||||
type: string
|
||||
- name: p_retailprice
|
||||
type: number
|
||||
- name: p_comment
|
||||
type: string
|
||||
27
python/klo-sl/sources/tpch/partsupp.yaml
Normal file
27
python/klo-sl/sources/tpch/partsupp.yaml
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
name: partsupp
|
||||
table: public.partsupp
|
||||
grain: [ps_partkey, ps_suppkey]
|
||||
columns:
|
||||
- name: ps_partkey
|
||||
type: number
|
||||
- name: ps_suppkey
|
||||
type: number
|
||||
- name: ps_availqty
|
||||
type: number
|
||||
- name: ps_supplycost
|
||||
type: number
|
||||
- name: ps_comment
|
||||
type: string
|
||||
joins:
|
||||
- to: part
|
||||
"on": ps_partkey = part.p_partkey
|
||||
relationship: many_to_one
|
||||
- to: supplier
|
||||
"on": ps_suppkey = supplier.s_suppkey
|
||||
relationship: many_to_one
|
||||
measures:
|
||||
- name: total_supply_cost
|
||||
expr: sum(ps_supplycost * ps_availqty)
|
||||
description: "Total value of parts in stock"
|
||||
- name: avg_supply_cost
|
||||
expr: avg(ps_supplycost)
|
||||
10
python/klo-sl/sources/tpch/region.yaml
Normal file
10
python/klo-sl/sources/tpch/region.yaml
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
name: region
|
||||
table: public.region
|
||||
grain: [r_regionkey]
|
||||
columns:
|
||||
- name: r_regionkey
|
||||
type: number
|
||||
- name: r_name
|
||||
type: string
|
||||
- name: r_comment
|
||||
type: string
|
||||
22
python/klo-sl/sources/tpch/supplier.yaml
Normal file
22
python/klo-sl/sources/tpch/supplier.yaml
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
name: supplier
|
||||
table: public.supplier
|
||||
grain: [s_suppkey]
|
||||
columns:
|
||||
- name: s_suppkey
|
||||
type: number
|
||||
- name: s_name
|
||||
type: string
|
||||
- name: s_address
|
||||
type: string
|
||||
- name: s_nationkey
|
||||
type: number
|
||||
- name: s_phone
|
||||
type: string
|
||||
- name: s_acctbal
|
||||
type: number
|
||||
- name: s_comment
|
||||
type: string
|
||||
joins:
|
||||
- to: nation
|
||||
"on": s_nationkey = nation.n_nationkey
|
||||
relationship: many_to_one
|
||||
Loading…
Add table
Add a link
Reference in a new issue