-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
Currently we use expr_to_columns to collect referenced columns from an expression. The usage is like:
let mut using_columns = HashSet::new();
expr_to_columns(expr, &mut using_columns)?;It is not convenient to use, because we need create a new HashSet everytime we invoke it. And the most usages of it is to collect from an single expression.
Describe the solution you'd like
Add a new method to Expr for collecting columns, like:
pub fn to_columns(&self) -> Result<HashSet<Column>> {
let mut using_columns = HashSet::new();
expr_to_columns(self, &mut using_columns)?;
Ok(using_columns)
}The usage will be like:
let using_columns = expr.to_columns()?;
...Describe alternatives you've considered
Additional context
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request