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

Example on how to query pyarrow table #93

Open
danthegoodman1 opened this issue Aug 22, 2023 · 3 comments
Open

Example on how to query pyarrow table #93

danthegoodman1 opened this issue Aug 22, 2023 · 3 comments
Labels
Arrow Apache Arrow support documentation Improvements or additions to documentation

Comments

@danthegoodman1
Copy link

The example for section Query On Table (Pandas DataFrame, Parquet file/bytes, Arrow bytes) on the readme has a dataframe example, but not pyarrow.

Also, question: is it zero-copy select?

@danthegoodman1
Copy link
Author

In [19]: import chdb.dataframe as cdf

In [20]: tbl = cdf.Table(arrow_table=arw)

In [21]: ret_tbl = tby.query('select * from __table__')

In [22]: print(ret_tbl)
   count()
0  3231245

Seems it's that easy, the chdb.dataframe naming is a bit confusing

@danthegoodman1
Copy link
Author

danthegoodman1 commented Aug 22, 2023

Bonus points for showing how to make it a virtual table with another name:

ret_tbl = cdf.query(sql='select * from __tb1__', tb1=cdf.Table(arrow_table=arw))

@lmangani lmangani added the documentation Improvements or additions to documentation label Aug 27, 2023
@auxten auxten added the Arrow Apache Arrow support label Apr 4, 2024
@auxten
Copy link
Member

auxten commented Apr 4, 2024

I will try to make chdb.dataframe just in chdb package.
This way we could also query dataframe in chdb Session.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Arrow Apache Arrow support documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

3 participants