MCPcopy Create free account
hub / github.com/apache/calcite / LatticeTest

Class LatticeTest

core/src/test/java/org/apache/calcite/test/LatticeTest.java:70–1028  ·  view source on GitHub ↗

Unit test for lattices.

Source from the content-addressed store, hash-verified

68 * Unit test for lattices.
69 */
70@Tag("slow")
71class LatticeTest {
72 private static final String SALES_LATTICE = "{\n"
73 + " name: 'star',\n"
74 + " sql: [\n"
75 + " 'select 1 from \"foodmart\".\"sales_fact_1997\" as \"s\"',\n"
76 + " 'join \"foodmart\".\"product\" as \"p\" using (\"product_id\")',\n"
77 + " 'join \"foodmart\".\"time_by_day\" as \"t\" using (\"time_id\")',\n"
78 + " 'join \"foodmart\".\"product_class\" as \"pc\" on \"p\".\"product_class_id\" = \"pc\".\"product_class_id\"'\n"
79 + " ],\n"
80 + " auto: false,\n"
81 + " algorithm: true,\n"
82 + " algorithmMaxMillis: 10000,\n"
83 + " rowCountEstimate: 86837,\n"
84 + " defaultMeasures: [ {\n"
85 + " agg: 'count'\n"
86 + " } ],\n"
87 + " tiles: [ {\n"
88 + " dimensions: [ 'the_year', ['t', 'quarter'] ],\n"
89 + " measures: [ {\n"
90 + " agg: 'sum',\n"
91 + " args: 'unit_sales'\n"
92 + " }, {\n"
93 + " agg: 'sum',\n"
94 + " args: 'store_sales'\n"
95 + " }, {\n"
96 + " agg: 'count'\n"
97 + " } ]\n"
98 + " } ]\n"
99 + "}\n";
100
101 private static final String INVENTORY_LATTICE = "{\n"
102 + " name: 'warehouse',\n"
103 + " sql: [\n"
104 + " 'select 1 from \"foodmart\".\"inventory_fact_1997\" as \"s\"',\n"
105 + " 'join \"foodmart\".\"product\" as \"p\" using (\"product_id\")',\n"
106 + " 'join \"foodmart\".\"time_by_day\" as \"t\" using (\"time_id\")',\n"
107 + " 'join \"foodmart\".\"warehouse\" as \"w\" using (\"warehouse_id\")'\n"
108 + " ],\n"
109 + " auto: false,\n"
110 + " algorithm: true,\n"
111 + " algorithmMaxMillis: 10000,\n"
112 + " rowCountEstimate: 4070,\n"
113 + " defaultMeasures: [ {\n"
114 + " agg: 'count'\n"
115 + " } ],\n"
116 + " tiles: [ {\n"
117 + " dimensions: [ 'the_year', 'warehouse_name'],\n"
118 + " measures: [ {\n"
119 + " agg: 'sum',\n"
120 + " args: 'store_invoice'\n"
121 + " }, {\n"
122 + " agg: 'sum',\n"
123 + " args: 'supply_time'\n"
124 + " }, {\n"
125 + " agg: 'sum',\n"
126 + " args: 'warehouse_cost'\n"
127 + " } ]\n"

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected