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

Implement a duckdb backend #1397

Closed
ahuang11 opened this issue Aug 22, 2024 · 1 comment · Fixed by #1398
Closed

Implement a duckdb backend #1397

ahuang11 opened this issue Aug 22, 2024 · 1 comment · Fixed by #1398
Labels
type: enhancement New feature or request

Comments

@ahuang11
Copy link
Collaborator

As duckdb popularity rises, I think it makes sense to add support for it, even if it's a thin wrapper

import pandas as pd
import duckdb

pd.DataFrame({"a": [1, 2, 3], "b": [4, 5, 6], "c": ["a", "b", "c"]}).to_parquet("example.parquet")

connection = duckdb.connect()
relation = connection.from_parquet("example.parquet").to_view("example")

relation = connection.execute("SELECT * FROM example")
relation.fetchdf().hvplot()  <- # simplify this to relation.hvplot()
@ahuang11 ahuang11 added the type: enhancement New feature or request label Aug 22, 2024
@ahuang11
Copy link
Collaborator Author

ahuang11 commented Aug 22, 2024

Seems to work for a simple case :O

import hvplot.duckdb

import pandas as pd
import duckdb

df = pd.DataFrame({
    'x': [1, 2, 3],
    'y': [4, 5, 6]
})

df.to_parquet('test.parquet')

connection = duckdb.connect(database=':memory:', read_only=False)
connection.from_parquet("test.parquet").hvplot(
    x='x', y='y', kind='scatter'
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant