#datafusion #rest #odata #sql #arrow

datafusion-odata

OData protocol adapter for Apache Datafusion

12 releases (5 major breaking)

40.0.0 Jul 16, 2024
39.0.0 Jun 11, 2024
38.0.0 May 28, 2024
37.2.0 Apr 11, 2024
0.4.0 Mar 15, 2024

#174 in HTTP server

Download history 194/week @ 2024-03-31 861/week @ 2024-04-07 279/week @ 2024-04-14 268/week @ 2024-04-21 161/week @ 2024-04-28 125/week @ 2024-05-05 104/week @ 2024-05-12 212/week @ 2024-05-19 190/week @ 2024-05-26 11/week @ 2024-06-02 136/week @ 2024-06-09 8/week @ 2024-06-16 14/week @ 2024-06-30 112/week @ 2024-07-14

126 downloads per month

Apache-2.0

245KB
906 lines

OData Adapter For Apache Datafusion

About

This is an OData API adapter for Apache Datafusion SQL engine.

OData protocol is positioned as "The SQL of REST", but is a somewhat legacy protocol used by some older systems. We wouldn't recommend using it as an integration protocol for some new project, but this adapter is useful if you have to integrate your Datafusion app with some existing OData-focused system.

Quick Start

Start example:

RUST_LOG=debug cargo run --example simple_service

Query using xh:

Service root:

xh GET 'http://localhost:3000/'

Metadata:

xh GET 'http://localhost:3000/$metadata'

Query collection:

xh GET 'http://localhost:3000/tickers.spy/?$select=offset,from_symbol,to_symbol,close&$top=5'

Status

This code is super raw and experimental. Very far from prod-ready. Use at your own risk.

  • Only support small subset of OData 3.0
  • Only supports atom format in responses
  • Service root resource
  • $metadata resource
  • Collection resource
    • $select
    • $orderby
    • $skip
    • $top
    • $filter
    • pagination
    • real object IDs
  • Collection entry by ID (service/collection(id))
    • Numeric IDs
    • Other ID types
  • Parameters
  • Nested collections
  • Functions
  • ...

Dependencies

~39–54MB
~1M SLoC