|
31 | 31 | #ifdef TPCH_ENABLE_ICEBERG |
32 | 32 | #include "tpch/iceberg_writer.hpp" |
33 | 33 | #endif |
| 34 | +#ifdef TPCH_ENABLE_LANCE |
| 35 | +#include "tpch/lance_writer.hpp" |
| 36 | +#endif |
34 | 37 |
|
35 | 38 | namespace { |
36 | 39 |
|
@@ -214,17 +217,16 @@ create_builders_from_schema(std::shared_ptr<arrow::Schema> schema) { |
214 | 217 | for (const auto& field : schema->fields()) { |
215 | 218 | if (field->type()->id() == arrow::Type::INT64) { |
216 | 219 | auto builder = std::make_shared<arrow::Int64Builder>(); |
217 | | - builder->Reserve(capacity); |
| 220 | + (void)builder->Reserve(capacity); |
218 | 221 | builders[field->name()] = builder; |
219 | 222 | } else if (field->type()->id() == arrow::Type::DOUBLE) { |
220 | 223 | auto builder = std::make_shared<arrow::DoubleBuilder>(); |
221 | | - builder->Reserve(capacity); |
| 224 | + (void)builder->Reserve(capacity); |
222 | 225 | builders[field->name()] = builder; |
223 | 226 | } else if (field->type()->id() == arrow::Type::STRING) { |
224 | 227 | auto builder = std::make_shared<arrow::StringBuilder>(); |
225 | | - // Reserve for values and estimate 50 bytes average string length |
226 | | - builder->Reserve(capacity); |
227 | | - builder->ReserveData(capacity * 50); |
| 228 | + (void)builder->Reserve(capacity); |
| 229 | + (void)builder->ReserveData(capacity * 50); |
228 | 230 | builders[field->name()] = builder; |
229 | 231 | } else { |
230 | 232 | throw std::runtime_error("Unsupported type: " + field->type()->ToString()); |
@@ -1422,16 +1424,16 @@ int main(int argc, char* argv[]) { |
1422 | 1424 | // Generate synthetic data |
1423 | 1425 | for (long row_idx = 0; row_idx < opts.max_rows; ++row_idx) { |
1424 | 1426 | // Add synthetic data to builders |
1425 | | - orderkey_builder->Append(row_idx + 1); |
1426 | | - partkey_builder->Append((row_idx % 200000) + 1); |
1427 | | - suppkey_builder->Append((row_idx % 10000) + 1); |
1428 | | - linenumber_builder->Append((row_idx % 7) + 1); |
1429 | | - quantity_builder->Append(10.0 + (row_idx % 50)); |
1430 | | - extprice_builder->Append((row_idx % 100) * 100.0); |
1431 | | - discount_builder->Append((row_idx % 10) * 0.1); |
1432 | | - tax_builder->Append((row_idx % 8) * 0.01); |
1433 | | - returnflag_builder->Append(row_idx % 3 == 0 ? "R" : (row_idx % 2 == 0 ? "A" : "N")); |
1434 | | - linestatus_builder->Append(row_idx % 2 == 0 ? "O" : "F"); |
| 1427 | + (void)orderkey_builder->Append(row_idx + 1); |
| 1428 | + (void)partkey_builder->Append((row_idx % 200000) + 1); |
| 1429 | + (void)suppkey_builder->Append((row_idx % 10000) + 1); |
| 1430 | + (void)linenumber_builder->Append((row_idx % 7) + 1); |
| 1431 | + (void)quantity_builder->Append(10.0 + static_cast<double>(row_idx % 50)); |
| 1432 | + (void)extprice_builder->Append(static_cast<double>(row_idx % 100) * 100.0); |
| 1433 | + (void)discount_builder->Append(static_cast<double>(row_idx % 10) * 0.1); |
| 1434 | + (void)tax_builder->Append(static_cast<double>(row_idx % 8) * 0.01); |
| 1435 | + (void)returnflag_builder->Append(row_idx % 3 == 0 ? "R" : (row_idx % 2 == 0 ? "A" : "N")); |
| 1436 | + (void)linestatus_builder->Append(row_idx % 2 == 0 ? "O" : "F"); |
1435 | 1437 |
|
1436 | 1438 | rows_in_batch++; |
1437 | 1439 | total_rows++; |
|
0 commit comments