Skip to content

Commit

Permalink
Allow VECTOR_SIZE=16, fix off-by-one in assertion and fix for NLJ wit…
Browse files Browse the repository at this point in the history
…h NULL values
  • Loading branch information
Mytherin committed Feb 19, 2020
1 parent 6ee2515 commit 6562ceb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/execution/operator/join/physical_nested_loop_join.cpp
Expand Up @@ -126,7 +126,9 @@ void PhysicalNestedLoopJoin::GetChunkInternal(ClientContext &context, DataChunk
} else {
// disqualify tuples from the RHS that have NULL values
for (index_t i = 0; i < state->right_chunks.chunks.size(); i++) {
state->has_null = state->has_null || RemoveNullValues(*state->right_chunks.chunks[i]);
if (RemoveNullValues(*state->right_chunks.chunks[i])) {
state->has_null = true;
}
}
// initialize the chunks for the join conditions
state->left_join_condition.Initialize(condition_types);
Expand Down
2 changes: 1 addition & 1 deletion src/execution/window_segment_tree.cpp
Expand Up @@ -56,7 +56,7 @@ void WindowSegmentTree::WindowSegmentValue(index_t l_idx, index_t begin, index_t
}
aggregate.update(&inputs.data[0], input_count, s);
} else {
assert(end - begin < STANDARD_VECTOR_SIZE);
assert(end - begin <= STANDARD_VECTOR_SIZE);
data_ptr_t ptr = levels_flat_native.get() + state.size() * (begin + levels_flat_start[l_idx - 1]);
Vector v(inputs, result_type, ptr);
v.Verify();
Expand Down
4 changes: 2 additions & 2 deletions src/include/duckdb/common/constants.hpp
Expand Up @@ -33,8 +33,8 @@ using std::vector;
#define STANDARD_VECTOR_SIZE 1024
#endif

#if (STANDARD_VECTOR_SIZE < 32) || ((STANDARD_VECTOR_SIZE & (STANDARD_VECTOR_SIZE - 1)) != 0)
#error Vector size should be a power of two and bigger than or equal to 32
#if (STANDARD_VECTOR_SIZE < 16) || ((STANDARD_VECTOR_SIZE & (STANDARD_VECTOR_SIZE - 1)) != 0)
#error Vector size should be a power of two and bigger than or equal to 16
#endif

//! a saner size_t for loop indices etc
Expand Down

0 comments on commit 6562ceb

Please sign in to comment.