Skip to content

Commit

Permalink
Shortcuts
Browse files Browse the repository at this point in the history
  • Loading branch information
krlmlr committed Oct 27, 2024
1 parent 4f04725 commit 134aae5
Showing 1 changed file with 23 additions and 19 deletions.
42 changes: 23 additions & 19 deletions src/rfuns.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -766,25 +766,29 @@ void InExecute(DataChunk &args, ExpressionState &state, Vector &result) {
auto y_data = FlatVector::GetData<RHS_TYPE>(ListVector::GetEntry(y));
auto y_mask = FlatVector::Validity(ListVector::GetEntry(y));

bool na_in_y = [&](){
if (!y_mask.AllValid()) {
idx_t y_base_idx = 0;
auto y_entry_count = ValidityMask::EntryCount(y_size);
for (idx_t y_entry_idx = 0; y_entry_idx < y_entry_count; y_entry_idx++) {
auto y_validity_entry = y_mask.GetValidityEntry(y_entry_idx);
idx_t y_next = MinValue<idx_t>(y_base_idx + ValidityMask::BITS_PER_VALUE, y_size);

if (!ValidityMask::AllValid(y_validity_entry)) {
if (ValidityMask::NoneValid(y_validity_entry)) {
return true;
} else {
idx_t y_start = y_base_idx;
for (; y_base_idx < y_next; y_base_idx++) {
if (!ValidityMask::RowIsValid(y_validity_entry, y_base_idx - y_start)) {
return true;
}
}
}
bool na_in_y = [&]() {
if (y_mask.AllValid()) {
return false;
}

idx_t y_base_idx = 0;
auto y_entry_count = ValidityMask::EntryCount(y_size);
for (idx_t y_entry_idx = 0; y_entry_idx < y_entry_count; y_entry_idx++) {
auto y_validity_entry = y_mask.GetValidityEntry(y_entry_idx);
idx_t y_next = MinValue<idx_t>(y_base_idx + ValidityMask::BITS_PER_VALUE, y_size);

if (ValidityMask::AllValid(y_validity_entry)) {
continue;
}

if (ValidityMask::NoneValid(y_validity_entry)) {
return true;
}

idx_t y_start = y_base_idx;
for (; y_base_idx < y_next; y_base_idx++) {
if (!ValidityMask::RowIsValid(y_validity_entry, y_base_idx - y_start)) {
return true;
}
}
}
Expand Down

0 comments on commit 134aae5

Please sign in to comment.