Skip to content

Conversation

@alamb
Copy link

@alamb alamb commented Nov 10, 2025

This is another PR that targets

There were several places in the code that assumed RowSelectionStrategy couldn't be Auto -- I wanted to see if I could encode this into the type system so it was less potentially problematic

I also think the context from @hhhizzz on apache#8733 (comment) was very important context so I adapted it as comments

}
}

/// Fully resolved strategy for materializing [`RowSelection`] during execution.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I eventually concluded that using a separate enum for the actual strategy to use was the clearest -- that way the type system encodes when Auto must have been resolved

}
plan_builder = plan_builder.with_row_selection_policy(self.row_selection_policy);

plan_builder = overide_selector_strategy_if_needed(
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also extracted this logic out into its own function, mostly so I could add the comments from apache#8733 (comment)


/// Overrider the selection strategy if needed.
///
/// Some pages can be skipped during row-group construction of they are not read
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these are based on apache#8733 (comment)

Auto {
/// Average selector length below which masks are preferred
threshold: usize,
/// Fallback to selectors when mask would be unsafe (e.g. page skipping)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

safe was always set to true, so I removed it as I believe it is redundant

@hhhizzz hhhizzz merged commit 1abae95 into hhhizzz:rowselectionempty Nov 11, 2025
16 checks passed
@alamb alamb deleted the alamb/add_policy branch November 11, 2025 12:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants