-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Using Rust and Polars with Postgres #4842
Comments
# https://github.com/pola-rs/polars/blob/master/py-polars/polars/io.py#L1018
def read_sql(
# ...
if _WITH_CX:
tbl = cx.read_sql(
conn=connection_uri,
query=sql,
return_type="arrow2", //<<<
partition_on=partition_on,
partition_range=partition_range,
partition_num=partition_num,
protocol=protocol,
)
return from_arrow(tbl) That is to say, you need ConnectorX to import data from DB into DataFrame(arrow) high speed from_arrow in rust maybe is DataFrame:try_from :
|
Full disclosure, I'm completely new to Polars and I'm still learning Rust.
Perhaps I have this completely wrong but it sounds like it isn't possible
to write something similar purely in Rust, correct?
https://github.com/pola-rs/polars/blob/master/py-polars/polars/io.py#L1018
…On Tue, Sep 13, 2022 at 4:28 AM huang12zheng ***@***.***> wrote:
- read
I just want show code for you:
# https://github.com/pola-rs/polars/blob/master/py-polars/polars/io.py#L1018def read_sql(# ...if _WITH_CX:
tbl = cx.read_sql(
conn=connection_uri,
query=sql,
return_type="arrow2", //<<<
partition_on=partition_on,
partition_range=partition_range,
partition_num=partition_num,
protocol=protocol,
)
return from_arrow(tbl)
That is to say, you need ConnectorX to import data from DB into
DataFrame(arrow) high speed
I'm not sure about that
from_arrow in rust maybe is DataFrame:try_from :
//
https://github.com/pola-rs/polars/blob/9991a0dd81c0e71a054b52e5f801579fc260e4c7/polars/polars-core/src/frame/from.rs
- write
It should be consistent with DOC
—
Reply to this email directly, view it on GitHub
<#4842 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABWXQ5CFFSSSQ2IOZEAGBEDV6A3JVANCNFSM6AAAAAAQLAWC3I>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
@spirrello |
what's more |
@huang12zheng Thank you so much for sharing these. I'll look these over today or tomorrow. |
Closing as the question has been answered. |
Research
I have searched the above polars tags on StackOverflow for similar questions.
I have asked my usage related question on StackOverflow.
Link to question on StackOverflow
https://stackoverflow.com/questions/73697218/how-to-use-polars-with-rust-and-postgres
Question about polars
Where can I find an easy to follow guide such as the following for Python? There doesn't seem to be anything for Rust.
https://pola-rs.github.io/polars-book/user-guide/howcani/io/postgres.html
The text was updated successfully, but these errors were encountered: