Skip to content

Add flightsql SQL driver#2619

Open
mkysel wants to merge 2 commits intoredpanda-data:mainfrom
mkysel:mkysel/flight
Open

Add flightsql SQL driver#2619
mkysel wants to merge 2 commits intoredpanda-data:mainfrom
mkysel:mkysel/flight

Conversation

@mkysel
Copy link
Copy Markdown
Contributor

@mkysel mkysel commented May 30, 2024

This is a small step in the Apache Arrow / FlightSQL direction. It is the minimal working improvement that is both easy and useful.

FlightSQL Driver: https://pkg.go.dev/github.com/apache/arrow/go/v14/arrow/flight/flightsql/driver#section-readme

I tested it against the new InfluxDBv3 which is flightsql/arrow compatible.

Docs for Influx here: https://www.influxdata.com/blog/two-methods-connecting-influxdb-3-0/

Example config:

input:
  sql_select:
    driver: flightsql
    dsn: flightsql://us-east-1-1.aws.cloud2.influxdata.com:443?bucket-name=get-started&tls=enabled&token=[token]
    table: census
    columns: [ '*' ]

I haven't yet figured out variable binding, but here are some breadcrumbs apache/arrow#40311

Comment thread public/components/sql/package.go Outdated
@zeroshade
Copy link
Copy Markdown

There might be benefit for a wider scope and potential if you target ADBC and then just use the FlightSQL driver for it.

That way it can be easily adapted to also allow using any of the ADBC drivers, such as snowflake, with minimal future changes.

Just an idea

@mkysel
Copy link
Copy Markdown
Contributor Author

mkysel commented Jun 5, 2024

One of the hiccups with this implementation is that not all FlightSQL endpoints support variable/parameter bindings. Those that do, use different dialects that either use $ or ?.

There are no integration tests since I tested this against influxv3 which does not have a docker image yet. I suspect @zeroshade might have ideas on what the easiest integration test might be against.

@zeroshade
Copy link
Copy Markdown

The open source Dremio docker image is likely the easiest integration test I can think of. Have a look at https://github.com/apache/arrow-adbc/blob/715fe2459a836527602383c50ecd40b8d520bb41/.github/workflows/integration.yml#L106 which is the CI workflow used for the flightsql integration testing for ADBC for examples of how to set it up.

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants