Using Adbc in Elixir with Dremio

I’m trying to connect with Dremio using Elixir’s Adbc (GitHub - elixir-explorer/adbc at v0.3.1) library which wraps the Adbc Flight Driver (you’ll have to google it because I’m only allowed two links. :frowning: )

It’s accessing a corporate Dremio instance managed by the company I work for. It uses a username/password for authentication. Authentication is successful using Python examples but I’m tasked with getting it to work in Elixir.

I have it set up according to the Adbc docs (Adbc — adbc v0.3.1).



children = [
  {Adbc.Database,
   driver: :sqlite,
   uri: "grpc://superfunmegacorp.com:32010",
   username: "johndoe",
   password: "nevergonnagiveyouup",
   process_options: [name: MyApp.DB]},
  {Adbc.Connection,
   database: MyApp.DB,
   process_options: [name: MyApp.Conn]}
]

Supervisor.start_link(children, strategy: :one_for_one)

It appears set up correctly until I try to query it like:

query = "SELECT 1"

{:ok, _} = Adbc.Connection.query(MyApp.Conn, query)

The error I’m getting is:

** (MatchError) no match of right hand side value: {:error, %ArgumentError{message: "[FlightSQL] error reading from server: EOF (Unavailable; DoGet: endpoint 0: [uri:"grpc+tcp://0.0.0.0:32010"])"}}
(arrow_ex 0.1.0) lib/arrow_ex.ex:145: ArrowEx.doit/0
iex:1: (file)

It’s quite mysterious to me why it would be replacing the domain name with 0.0.0.0. Any ideas how to chase this down?

This turned out to be due to a bug in Dremio version <24.3.4 as reported here - [Python] Querying Dremio with the ADBC Flight SQL client · Issue #1559 · apache/arrow-adbc · GitHub

Hey @GenericJam did you get this to work ? I’m a little surprised by the use of the :sqlite adapter in the code that you provided. It doesn’t seem like the sqlite adapter would be able to pass along a username and password (or token) that would be necessary to authenticate against a Dremio instance.

I did (not) get it to work. This is the code that would work if not for the bug linked above,

This is code for Livebook that I think would work.

query = """
SELECT 1"
"""

db =
Kino.start_child!({
Adbc.Database,
driver: :flightsql, uri: uri, username: uid, password: pwd
})

conn = Kino.start_child!({Adbc.Connection, database: db})

{:ok, _} = Adbc.Connection.query(conn, query 

Are you looking to do something similar?