An open API service indexing awesome lists of open source software.

https://github.com/systemxlabs/datafusion-remote-table

A DataFusion table provider for executing SQL queries on remote databases.
https://github.com/systemxlabs/datafusion-remote-table

datafusion mysql oracle postgresql rust sql sqlite

Last synced: 9 months ago
JSON representation

A DataFusion table provider for executing SQL queries on remote databases.

Awesome Lists containing this project

README

          

# datafusion-remote-table
![License](https://img.shields.io/badge/license-MIT-blue.svg)
[![Crates.io](https://img.shields.io/crates/v/datafusion-remote-table.svg)](https://crates.io/crates/datafusion-remote-table)

## Features
1. Execute SQL queries on remote databases and stream results as datafusion table provider
2. Support inferring schema or user specified schema
3. Support pushing down filters and limit to remote databases
4. Execution plan can be serialized for distributed execution
5. Record batches can be transformed before outputting to next plan node

## Usage
```rust
#[tokio::main]
pub async fn main() -> Result<(), Box> {
let options = ConnectionOptions::Postgres(PostgresConnectionOptions::new(
"localhost",
5432,
"user",
"password",
));
let remote_table = RemoteTable::try_new(options, "select * from supported_data_types").await?;

let ctx = SessionContext::new();
ctx.register_table("remote_table", Arc::new(remote_table))?;

ctx.sql("select * from remote_table").await?.show().await?;

Ok(())
}
```

## Supported databases
- [x] Postgres
- [x] Int2 / Int4 / Int8
- [x] Float4 / Float8 / Numeric
- [x] Char / Varchar / Text / Bpchar / Bytea
- [x] Date / Time / Timestamp / Timestamptz / Interval
- [x] Bool / Oid / Name / Json / Jsonb / Geometry(PostGIS)
- [x] Int2[] / Int4[] / Int8[]
- [x] Float4[] / Float8[]
- [x] Char[] / Varchar[] / Bpchar[] / Text[] / Bytea[]
- [x] MySQL
- [x] TinyInt (Unsigned) / Smallint (Unsigned) / MediumInt (Unsigned) / Int (Unsigned) / Bigint (Unsigned)
- [x] Float / Double / Decimal
- [x] Date / DateTime / Time / Timestamp / Year
- [x] Char / Varchar / Binary / Varbinary
- [x] TinyText / Text / MediumText / LongText
- [x] TinyBlob / Blob / MediumBlob / LongBlob
- [x] Json / Geometry
- [x] Oracle
- [x] Number / BinaryFloat / BinaryDouble / Float
- [x] Varchar2 / NVarchar2 / Char / NChar / Long / Clob / NClob
- [x] Raw / Long Raw / Blob
- [x] Date / Timestamp
- [x] Boolean
- [x] SQLite
- [x] Null / Integer / Real / Text / Blob

## Thanks
- [datafusion-table-providers](https://crates.io/crates/datafusion-table-providers)