chdb-io / chdb

chDB is an in-process OLAP SQL Engine 🚀 powered by ClickHouse
https://clickhouse.com/docs/en/chdb
Apache License 2.0
2.03k stars 72 forks source link

R API! #72

Open alanpaulkwan opened 1 year ago

alanpaulkwan commented 1 year ago

R has a wonderful data science community. It would be great if there was an R binding.

The DuckDB API is built here, I wonder if this could be template code:

https://github.com/duckdb/duckdb/tree/master/tools/rpkg/R

Worst case, R can do reticulate, which is a Python wrapper.

lmangani commented 1 year ago

Thanks for the request. R binding can be supported in libchdb where we have hooks for Go, NodeJS, Rust, etc.

I'm not familiar with R development, but it seems very close to the C/C++ binding. This template could be a starting point: https://gist.github.com/lmangani/e30edae31ad939e539989b8e326fb449

dwinkler1 commented 6 months ago

I'm a contributor to the RClickhouse package that integrates Clickhouse with R's DBI package. We are wrapping the C++ Clickhouse library to do that. One of the major struggles was to handle data types (R still doesn't support 64bit INTs for example). Maybe our package can provide inspiration. https://github.com/IMSMWU/RClickhouse/tree/master