Whether the client has been authenticated via handshake.
Whether the client has been closed.
The base URL of the Flight server.
Authenticate with the server using configured credentials.
For basic auth, this calls the Handshake RPC. For bearer auth, no action is needed (token is sent in headers).
The authentication token (if applicable)
Close the client and release resources. After calling close, the client should not be used.
Execute a custom action on the server.
The action to execute (type and optional body)
Retrieve flight data for the given ticket. Returns an async iterable of FlightData messages.
Use the IPC decoding utilities to convert FlightData to Arrow RecordBatches:
decodeFlightDataStream() - decode to RecordBatch streamdecodeFlightDataToTable() - decode to a single TableThe ticket identifying the data to retrieve
Upload data to the server. Returns an async iterable of PutResult messages containing server acknowledgements.
Use the IPC encoding utilities to create FlightData from Arrow data:
encodeRecordBatchesToFlightData() - encode RecordBatch streamencodeTableToFlightData() - encode a TableAsync iterable of FlightData messages to upload (include descriptor in first message)
import { encodeTableToFlightData } from "@qualithm/arrow-flight-client"
const descriptor = { type: "path", path: ["my", "table"] }
const flightData = encodeTableToFlightData(table)
// Add descriptor to first message
async function* withDescriptor() {
let first = true
for await (const data of flightData) {
if (first) {
yield { ...data, flightDescriptor: descriptor }
first = false
} else {
yield data
}
}
}
for await (const result of client.doPut(withDescriptor())) {
console.log("Server acknowledged:", result.appMetadata)
}
Get information about a specific flight.
Flight descriptor identifying the dataset
Flight information including schema and endpoints
Get the schema for a flight.
Flight descriptor identifying the dataset
Schema result containing the Arrow schema bytes
Perform Flight Handshake authentication.
This method is automatically called for clients configured with auth: { type: "basic" }.
For custom handshake payloads, call this method directly with raw bytes.
Optionalpayload: Uint8Array<ArrayBufferLike>Raw handshake payload (defaults to BasicAuth if auth.type is "basic")
The authentication token from the server
List available flights matching the given criteria.
Optionalcriteria: FlightCriteriaOptional filter criteria for listing flights
Poll for updated flight information (useful for long-running queries).
Flight descriptor identifying the dataset
Poll information with progress and updated flight info
Low-level Arrow Flight client for communicating with Flight servers.
This client provides access to all core Flight RPC methods. For SQL operations, use
FlightSqlClientinstead.Example