Skip to content

Commit 1015c1c

Browse files
tsafinclaude
andcommitted
Phase 5 final: Re-include tables.h with TPCDS_* aliases and PascalCase enum
- Re-added #include "tables.h" to tpcds_dsdgen.h - Changed TPCDS_* from literal values to aliases (e.g., #define TPCDS_CALL_CENTER CALL_CENTER) - This allows using the canonical build-generated constants while avoiding macro collisions - Renamed TableType enum members to PascalCase (CallCenter, CatalogPage, etc.) to avoid colliding with ALL_CAPS macros from tables.h - Updated all TableType:: references throughout dsdgen_wrapper.cpp and tpcds_main.cpp - All 24 TPC-DS tables now fully functional via CLI and generation dispatch This maintains the canonical struct layouts (by including real tpcds headers) while resolving namespace conflicts through C++ enum conventions. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
1 parent 5f5f6e1 commit 1015c1c

5 files changed

Lines changed: 251 additions & 154 deletions

File tree

include/tpch/dsdgen_converter.hpp

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,104 @@ void append_web_returns_to_builders(
8686
const void* row,
8787
std::map<std::string, std::shared_ptr<arrow::ArrayBuilder>>& builders);
8888

89+
/**
90+
* Append a call_center row (CALL_CENTER_TBL*) to Arrow builders.
91+
*/
92+
void append_call_center_to_builders(
93+
const void* row,
94+
std::map<std::string, std::shared_ptr<arrow::ArrayBuilder>>& builders);
95+
96+
/**
97+
* Append a catalog_page row (CATALOG_PAGE_TBL*) to Arrow builders.
98+
*/
99+
void append_catalog_page_to_builders(
100+
const void* row,
101+
std::map<std::string, std::shared_ptr<arrow::ArrayBuilder>>& builders);
102+
103+
/**
104+
* Append a web_page row (W_WEB_PAGE_TBL*) to Arrow builders.
105+
*/
106+
void append_web_page_to_builders(
107+
const void* row,
108+
std::map<std::string, std::shared_ptr<arrow::ArrayBuilder>>& builders);
109+
110+
/**
111+
* Append a web_site row (W_WEB_SITE_TBL*) to Arrow builders.
112+
*/
113+
void append_web_site_to_builders(
114+
const void* row,
115+
std::map<std::string, std::shared_ptr<arrow::ArrayBuilder>>& builders);
116+
117+
/**
118+
* Append a warehouse row (W_WAREHOUSE_TBL*) to Arrow builders.
119+
*/
120+
void append_warehouse_to_builders(
121+
const void* row,
122+
std::map<std::string, std::shared_ptr<arrow::ArrayBuilder>>& builders);
123+
124+
/**
125+
* Append a ship_mode row (W_SHIP_MODE_TBL*) to Arrow builders.
126+
*/
127+
void append_ship_mode_to_builders(
128+
const void* row,
129+
std::map<std::string, std::shared_ptr<arrow::ArrayBuilder>>& builders);
130+
131+
/**
132+
* Append a household_demographics row (W_HOUSEHOLD_DEMOGRAPHICS_TBL*) to Arrow builders.
133+
*/
134+
void append_household_demographics_to_builders(
135+
const void* row,
136+
std::map<std::string, std::shared_ptr<arrow::ArrayBuilder>>& builders);
137+
138+
/**
139+
* Append a customer_demographics row (W_CUSTOMER_DEMOGRAPHICS_TBL*) to Arrow builders.
140+
*/
141+
void append_customer_demographics_to_builders(
142+
const void* row,
143+
std::map<std::string, std::shared_ptr<arrow::ArrayBuilder>>& builders);
144+
145+
/**
146+
* Append a customer_address row (W_CUSTOMER_ADDRESS_TBL*) to Arrow builders.
147+
*/
148+
void append_customer_address_to_builders(
149+
const void* row,
150+
std::map<std::string, std::shared_ptr<arrow::ArrayBuilder>>& builders);
151+
152+
/**
153+
* Append an income_band row (W_INCOME_BAND_TBL*) to Arrow builders.
154+
*/
155+
void append_income_band_to_builders(
156+
const void* row,
157+
std::map<std::string, std::shared_ptr<arrow::ArrayBuilder>>& builders);
158+
159+
/**
160+
* Append a reason row (W_REASON_TBL*) to Arrow builders.
161+
*/
162+
void append_reason_to_builders(
163+
const void* row,
164+
std::map<std::string, std::shared_ptr<arrow::ArrayBuilder>>& builders);
165+
166+
/**
167+
* Append a time_dim row (W_TIME_TBL*) to Arrow builders.
168+
*/
169+
void append_time_dim_to_builders(
170+
const void* row,
171+
std::map<std::string, std::shared_ptr<arrow::ArrayBuilder>>& builders);
172+
173+
/**
174+
* Append a promotion row (W_PROMOTION_TBL*) to Arrow builders.
175+
*/
176+
void append_promotion_to_builders(
177+
const void* row,
178+
std::map<std::string, std::shared_ptr<arrow::ArrayBuilder>>& builders);
179+
180+
/**
181+
* Append a store row (W_STORE_TBL*) to Arrow builders.
182+
*/
183+
void append_store_to_builders(
184+
const void* row,
185+
std::map<std::string, std::shared_ptr<arrow::ArrayBuilder>>& builders);
186+
89187
/**
90188
* Generic dispatcher by table name.
91189
*/

include/tpch/dsdgen_wrapper.hpp

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -14,31 +14,31 @@ namespace tpcds {
1414
* Numeric values match the generated tables.h constants (STORE_SALES=17, etc.).
1515
*/
1616
enum class TableType {
17-
CALL_CENTER = 0,
18-
CATALOG_PAGE = 1,
19-
CATALOG_RETURNS = 2,
20-
CATALOG_SALES = 3,
21-
CUSTOMER = 4,
22-
CUSTOMER_ADDRESS = 5,
23-
CUSTOMER_DEMOGRAPHICS = 6,
24-
DATE_DIM = 7,
25-
HOUSEHOLD_DEMOGRAPHICS = 8,
26-
INCOME_BAND = 9,
27-
INVENTORY = 10,
28-
ITEM = 11,
29-
PROMOTION = 12,
30-
REASON = 13,
31-
SHIP_MODE = 14,
32-
STORE = 15,
33-
STORE_RETURNS = 16,
34-
STORE_SALES = 17,
35-
TIME_DIM = 18,
36-
WAREHOUSE = 19,
37-
WEB_PAGE = 20,
38-
WEB_RETURNS = 21,
39-
WEB_SALES = 22,
40-
WEB_SITE = 23,
41-
COUNT_
17+
CallCenter = 0,
18+
CatalogPage = 1,
19+
CatalogReturns = 2,
20+
CatalogSales = 3,
21+
Customer = 4,
22+
CustomerAddress = 5,
23+
CustomerDemographics = 6,
24+
DateDim = 7,
25+
HouseholdDemographics = 8,
26+
IncomeBand = 9,
27+
Inventory = 10,
28+
Item = 11,
29+
Promotion = 12,
30+
Reason = 13,
31+
ShipMode = 14,
32+
Store = 15,
33+
StoreReturns = 16,
34+
StoreSales = 17,
35+
TimeDim = 18,
36+
Warehouse = 19,
37+
WebPage = 20,
38+
WebReturns = 21,
39+
WebSales = 22,
40+
WebSite = 23,
41+
Count_
4242
};
4343

4444
/**

0 commit comments

Comments
 (0)