Skip to content

Commit

Permalink
Fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lriggs committed Nov 6, 2023
1 parent 4bd53e2 commit b4af98a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 3 additions & 1 deletion cpp/src/gandiva/annotator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ FieldDescriptorPtr Annotator::MakeDesc(FieldPtr field, bool is_output) {
data_buffer_ptr_idx = buffer_count_++;
}
int child_valid_buffer_ptr_idx = FieldDescriptor::kInvalidIdx;
child_valid_buffer_ptr_idx = buffer_count_++;
if (field->type()->id() == arrow::Type::LIST) {
child_valid_buffer_ptr_idx = buffer_count_++;
}
return std::make_shared<FieldDescriptor>(field, data_idx, validity_idx, offsets_idx,
data_buffer_ptr_idx, child_offsets_idx, child_valid_buffer_ptr_idx);
}
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/gandiva/array_ops_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ TEST(TestArrayOps, TestInt32ContainsInt32) {

EXPECT_EQ(
array_int32_contains_int32(ctx_ptr, data, entry_offsets_len, &entry_validity,
true, contains_data, true, 0, 0, &valid),
true, contains_data, true, 0, 3, &valid),
true);
}

Expand Down
2 changes: 0 additions & 2 deletions cpp/src/gandiva/llvm_generator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -787,10 +787,8 @@ void LLVMGenerator::Visitor::Visit(const VectorReadVarLenValueListDex& dex) {
builder->CreateAdd(loop_var_, GetSliceOffset(dex.OffsetsIdx()));

int i = 0;
std::cout << "VectorReadVarLenValueListDex " << i++ << std::endl;
// => offset_start = offsets[loop_var]
slot = builder->CreateGEP(type, offsets_slot_ref, offsets_slot_index);
std::cout << "VectorReadVarLenValueListDex " << i++ << std::endl;
llvm::Value* offset_start = builder->CreateLoad(type, slot, "offset_start");

// => offset_end = offsets[loop_var + 1]
Expand Down

0 comments on commit b4af98a

Please sign in to comment.