Skip to content

Binding from a generic ADBC client #81

Open

Description

@tokoko

Hey, I'm working on a Spark DataSource connector that talks to databases through ADBC (https://github.com/tokoko/spark-adbc). It pushes filters down, and I'd like it to send filter values as bound parameters instead of rendering them as SQL literals as constructing literals for different engines is far from straightforward.

I found that for most of the drivers (at least the ones that are installable with dbc) this works well and avoids the need for having to declare literal syntax flags as driver info codes (see here) as long as the driver tells you what parameter marker to use. Most other drivers use one of the few markers (?, $1, :1 or @p1) and don't require type information to be included.

Binding itself works fine with clickhouse as well, but for a generic adbc client there's no easy way to actually construct a query that needs to contain a clickhouse-specific type name in it. I saw that untyped ? used to be a thing in the rust client and was deprecated, but still thought I'd ask here for a possible solution to this. Is there any way for a generic adbc client to construct a query with bound parameters with arrow type knowledge only? Having some sort of an Arrow-to-ClickHouse type table inside a client that otherwise knows nothing about ClickHouse doesn't seem too appealing.

Thanks

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions