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

NestedJoin is not implemented #18005

Closed
2 tasks done
wangxiaoying opened this issue Aug 1, 2024 · 0 comments · Fixed by #18006
Closed
2 tasks done

NestedJoin is not implemented #18005

wangxiaoying opened this issue Aug 1, 2024 · 0 comments · Fixed by #18006
Labels
A-sql Area: Polars SQL functionality bug Something isn't working python Related to Python Polars

Comments

@wangxiaoying
Copy link
Contributor

wangxiaoying commented Aug 1, 2024

Checks

  • I have checked that this issue has not already been reported.
  • I have confirmed this bug exists on the latest version of Polars.

Reproducible example

import polars as pl

df1 = pl.DataFrame(
        {
            "id": [1, 2, 3, 4],
            "name": ["a", "b", "c", "d"]
        }
    )
df2 = pl.DataFrame(
        {
            "id": [1, 2, 3, 5],
            "type": ["ta", "tb", "tc", "td"]
        }
    )
df3 = pl.DataFrame(
        {
            "id": [1, 2, 5, 6],
            "class": ["ca", "cb", "cc", "cd"]
        }
    )

ctx = pl.SQLContext()
ctx.register("df1", df1)
ctx.register("df2", df2)
ctx.register("df3", df3)

lf = ctx.execute("select df1.id, df1.name, df2.type, df3.class from df1 inner join (df2 inner join df3 on df2.id=df3.id) on df1.id=df2.id")

Log output

polars.exceptions.SQLInterfaceError: not yet implemented: (df2 JOIN df3 ON df2.id = df3.id)

Issue description

NestedJoin is not implemented

Expected behavior

Query executed correctly, as the same query can be executed on postgres. (Enabling this can also use nested join to control the join order manually)

Installed versions

--------Version info---------
Polars:               1.3.0
Index type:           UInt32
Platform:             macOS-13.2.1-arm64-arm-64bit
Python:               3.11.8 (main, Feb 22 2024, 21:34:36) [Clang 14.0.0 (clang-1400.0.29.202)]

----Optional dependencies----
adbc_driver_manager:  <not installed>
cloudpickle:          <not installed>
connectorx:           0.3.3
deltalake:            <not installed>
fastexcel:            <not installed>
fsspec:               <not installed>
gevent:               <not installed>
great_tables:         <not installed>
hvplot:               <not installed>
matplotlib:           3.9.1
nest_asyncio:         1.6.0
numpy:                1.26.4
openpyxl:             <not installed>
pandas:               2.2.2
pyarrow:              16.1.0
pydantic:             <not installed>
pyiceberg:            <not installed>
sqlalchemy:           2.0.31
torch:                <not installed>
xlsx2csv:             <not installed>
xlsxwriter:           <not installed>
@wangxiaoying wangxiaoying added bug Something isn't working needs triage Awaiting prioritization by a maintainer python Related to Python Polars labels Aug 1, 2024
@alexander-beedie alexander-beedie added A-sql Area: Polars SQL functionality and removed needs triage Awaiting prioritization by a maintainer labels Aug 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-sql Area: Polars SQL functionality bug Something isn't working python Related to Python Polars
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants