MCPcopy Create free account
hub / github.com/apache/datafusion / tpch_schemas

Function tpch_schemas

test-utils/src/tpch.rs:22–118  ·  view source on GitHub ↗

Schemas for the TPCH tables

()

Source from the content-addressed store, hash-verified

20
21/// Schemas for the TPCH tables
22pub fn tpch_schemas() -> Vec<TableDef> {
23 let lineitem_schema = Schema::new(vec![
24 Field::new("l_orderkey", DataType::Int64, false),
25 Field::new("l_partkey", DataType::Int64, false),
26 Field::new("l_suppkey", DataType::Int64, false),
27 Field::new("l_linenumber", DataType::Int32, false),
28 Field::new("l_quantity", DataType::Decimal128(15, 2), false),
29 Field::new("l_extendedprice", DataType::Decimal128(15, 2), false),
30 Field::new("l_discount", DataType::Decimal128(15, 2), false),
31 Field::new("l_tax", DataType::Decimal128(15, 2), false),
32 Field::new("l_returnflag", DataType::Utf8, false),
33 Field::new("l_linestatus", DataType::Utf8, false),
34 Field::new("l_shipdate", DataType::Date32, false),
35 Field::new("l_commitdate", DataType::Date32, false),
36 Field::new("l_receiptdate", DataType::Date32, false),
37 Field::new("l_shipinstruct", DataType::Utf8, false),
38 Field::new("l_shipmode", DataType::Utf8, false),
39 Field::new("l_comment", DataType::Utf8, false),
40 ]);
41
42 let orders_schema = Schema::new(vec![
43 Field::new("o_orderkey", DataType::Int64, false),
44 Field::new("o_custkey", DataType::Int64, false),
45 Field::new("o_orderstatus", DataType::Utf8, false),
46 Field::new("o_totalprice", DataType::Decimal128(15, 2), false),
47 Field::new("o_orderdate", DataType::Date32, false),
48 Field::new("o_orderpriority", DataType::Utf8, false),
49 Field::new("o_clerk", DataType::Utf8, false),
50 Field::new("o_shippriority", DataType::Int32, false),
51 Field::new("o_comment", DataType::Utf8, false),
52 ]);
53
54 let part_schema = Schema::new(vec![
55 Field::new("p_partkey", DataType::Int64, false),
56 Field::new("p_name", DataType::Utf8, false),
57 Field::new("p_mfgr", DataType::Utf8, false),
58 Field::new("p_brand", DataType::Utf8, false),
59 Field::new("p_type", DataType::Utf8, false),
60 Field::new("p_size", DataType::Int32, false),
61 Field::new("p_container", DataType::Utf8, false),
62 Field::new("p_retailprice", DataType::Decimal128(15, 2), false),
63 Field::new("p_comment", DataType::Utf8, false),
64 ]);
65
66 let supplier_schema = Schema::new(vec![
67 Field::new("s_suppkey", DataType::Int64, false),
68 Field::new("s_name", DataType::Utf8, false),
69 Field::new("s_address", DataType::Utf8, false),
70 Field::new("s_nationkey", DataType::Int64, false),
71 Field::new("s_phone", DataType::Utf8, false),
72 Field::new("s_acctbal", DataType::Decimal128(15, 2), false),
73 Field::new("s_comment", DataType::Utf8, false),
74 ]);
75
76 let partsupp_schema = Schema::new(vec![
77 Field::new("ps_partkey", DataType::Int64, false),
78 Field::new("ps_suppkey", DataType::Int64, false),
79 Field::new("ps_availqty", DataType::Int32, false),

Callers 1

criterion_benchmarkFunction · 0.85

Calls 1

newFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…