Skip to content

Example showing how to provide "flight call options" when making a connection against a (quackpy) Flight SQL server #28

@mskyttner

Description

@mskyttner

Trying to figure out how to use adbi to get a connection to a Flight SQL server and while able to successfully get a connection against Voltron's sqlflite server - reproducable w containers here, I am stuck on authenticating against another containerized server quackpy.

From python the following can be used to establish a connection against the quackpy Flight SQL server:

from pyarrow.flight import FlightClient, Ticket, FlightCallOptions 
sql="""SELECT version()"""  
flight_ticket = Ticket(sql)

token = (b"authorization", bytes(f"user:persistence".encode('utf-8')))
options = FlightCallOptions(headers=[token])
client = FlightClient(f"grpc://localhost:8815")
reader = client.do_get(flight_ticket, options)
arrow_table = reader.read_all()

From R, using adbi, how do I provide the equivalent "FlightCallOptions" when initiating the connection?

Attempting to provide authentication details through the uri (I might be doing this wrong obviously) I get a server response like below:

./fly.R grpc://user:persistence@localhost:8815/ "from lineitem limit 5;"
Registered S3 methods overwritten by 'adbi':
  method                      from
  infer_nanoarrow_schema.AsIs nanoarrow
  infer_nanoarrow_schema.list nanoarrow
Error in force(code) :
  IO: [FlightSQL] write tcp 127.0.0.1:52716->127.0.0.1:8815: write: broken pipe (Unavailable; AuthenticateBasicToken)
Calls: <Anonymous> ... <Anonymous> -> with_adbc -> force -> stop_for_error
Execution halted

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions