Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEAT]: sql IN operator #3086

Merged
merged 5 commits into from
Oct 23, 2024
Merged

Conversation

universalmind303
Copy link
Contributor

closes #3085

@github-actions github-actions bot added the enhancement New feature or request label Oct 21, 2024
Copy link

codspeed-hq bot commented Oct 21, 2024

CodSpeed Performance Report

Merging #3086 will not alter performance

Comparing universalmind303:sql-in (fe480fa) with main (c69ee3f)

Summary

✅ 17 untouched benchmarks

Copy link
Contributor

@andrewgazelka andrewgazelka left a comment

Choose a reason for hiding this comment

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

approving. please at least consider recommendations.

tests/sql/test_exprs.py Show resolved Hide resolved
let list = list
.iter()
.map(|e| self.plan_lit(e))
.collect::<SQLPlannerResult<Vec<_>>>()?;
Copy link
Contributor

Choose a reason for hiding this comment

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

nit:

Suggested change
.collect::<SQLPlannerResult<Vec<_>>>()?;
.try_collect()?;

and then let list: Vec<_> = ...

This is more appealing to me. Can be done with itertools or since we are using nightly it is a feature as well.

let series = literals_to_series(&list)?;
let series_lit = LiteralValue::Series(series);
let series_expr = Expr::Literal(series_lit);
let series_expr_arc = Arc::new(series_expr);
Copy link
Contributor

Choose a reason for hiding this comment

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

let series_expr = Expr::Literal(series_lit);
let series_expr_arc = Arc::new(series_expr);
let expr = expr.is_in(series_expr_arc);
if *negated {
Copy link
Contributor

Choose a reason for hiding this comment

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

this seems to be repeated a bunch. don't know if there is a way to make this simpler negate_if ? or if this is just a bit too much. I could see accidentally missing .not in one of these. unsure though feel free to do nothing.

@universalmind303 universalmind303 enabled auto-merge (squash) October 23, 2024 16:41
@universalmind303 universalmind303 merged commit 4ec76ce into Eventual-Inc:main Oct 23, 2024
38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SQL: Support IN/NOT IN operator
2 participants