Skip to content

Commit 612b723

Browse files
tsafinclaude
andcommitted
fix: resolve build errors after rebase - missing lance include and Arrow Status warnings
Add missing lance_writer.hpp include lost during rebase, suppress nodiscard warnings on Arrow Status returns, and fix long-to-double conversion warnings. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 19e94b3 commit 612b723

1 file changed

Lines changed: 17 additions & 15 deletions

File tree

src/main.cpp

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@
3131
#ifdef TPCH_ENABLE_ICEBERG
3232
#include "tpch/iceberg_writer.hpp"
3333
#endif
34+
#ifdef TPCH_ENABLE_LANCE
35+
#include "tpch/lance_writer.hpp"
36+
#endif
3437

3538
namespace {
3639

@@ -214,17 +217,16 @@ create_builders_from_schema(std::shared_ptr<arrow::Schema> schema) {
214217
for (const auto& field : schema->fields()) {
215218
if (field->type()->id() == arrow::Type::INT64) {
216219
auto builder = std::make_shared<arrow::Int64Builder>();
217-
builder->Reserve(capacity);
220+
(void)builder->Reserve(capacity);
218221
builders[field->name()] = builder;
219222
} else if (field->type()->id() == arrow::Type::DOUBLE) {
220223
auto builder = std::make_shared<arrow::DoubleBuilder>();
221-
builder->Reserve(capacity);
224+
(void)builder->Reserve(capacity);
222225
builders[field->name()] = builder;
223226
} else if (field->type()->id() == arrow::Type::STRING) {
224227
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);
228230
builders[field->name()] = builder;
229231
} else {
230232
throw std::runtime_error("Unsupported type: " + field->type()->ToString());
@@ -1422,16 +1424,16 @@ int main(int argc, char* argv[]) {
14221424
// Generate synthetic data
14231425
for (long row_idx = 0; row_idx < opts.max_rows; ++row_idx) {
14241426
// 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");
14351437

14361438
rows_in_batch++;
14371439
total_rows++;

0 commit comments

Comments
 (0)