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(polars): support scalar subqueries for Polars backend #9422

Open
1 task done
lostmygithubaccount opened this issue Jun 21, 2024 · 0 comments
Open
1 task done
Labels
feature Features or general enhancements

Comments

@lostmygithubaccount
Copy link
Member

Is your feature request related to a problem?

in running TPC-H queries on the Polars backend with Ibis, 9/22 fail due to lack of scalar subquery support

What is the motivation behind your request?

mostly to have an issue to point to and discuss -- I'm not sure to what extent scalar subqueries are supported in Polars, but at least a very simple example works that fails for Ibis:

[ins] In [6]: df = t.to_polars()

[ins] In [7]: df.filter(df["bill_length_mm"] == df["bill_length_mm"].min())
Out[7]:
shape: (1, 8)
┌─────────┬────────┬────────────────┬───────────────┬───────────────────┬─────────────┬────────┬──────┐
│ species ┆ island ┆ bill_length_mm ┆ bill_depth_mm ┆ flipper_length_mm ┆ body_mass_g ┆ sex    ┆ year │
│ ---     ┆ ---    ┆ ---            ┆ ---           ┆ ---               ┆ ---         ┆ ---    ┆ ---  │
│ str     ┆ str    ┆ f64            ┆ f64           ┆ i64               ┆ i64         ┆ str    ┆ i64  │
╞═════════╪════════╪════════════════╪═══════════════╪═══════════════════╪═════════════╪════════╪══════╡
│ Adelie  ┆ Dream  ┆ 32.1           ┆ 15.5          ┆ 188               ┆ 3050        ┆ female ┆ 2009 │
└─────────┴────────┴────────────────┴───────────────┴───────────────────┴─────────────┴────────┴──────┘

Describe the solution you'd like

this would work:

[ins] In [1]: import ibis

[ins] In [2]: ibis.options.interactive = True

[ins] In [3]: ibis.set_backend("polars")

[ins] In [4]: t = ibis.examples.penguins.fetch()

[ins] In [5]: t.filter(t["bill_length_mm"] == t["bill_length_mm"].min())
Out[5]: 

[lots of traceback ommitted]

OperationNotDefinedError: No translation rule for <class 'ibis.expr.operations.subqueries.ScalarSubquery'>

What version of ibis are you running?

main, 9.1.0

What backend(s) are you using, if any?

Polars

Code of Conduct

  • I agree to follow this project's Code of Conduct
@lostmygithubaccount lostmygithubaccount added the feature Features or general enhancements label Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Features or general enhancements
Projects
Status: backlog
Development

No branches or pull requests

1 participant