Arrow Flight Client Node.js
On this page

Arrow Flight Client

TypeScript 7 Python 3 10 gRPC methods 0.0.19

An Apache Arrow Flight client for Node.js. It provides typed access to every unary and streaming gRPC method in the official Flight protocol definition.

Installation

Install the client and its required apache-arrow peer dependency in your project.

Shell
npm install arrow-flight-client apache-arrow

Read a table

Start the local Flight server. It serves a table with the descriptor demo/people. Call getFlightInfo() to get information about the table, then pass the returned ticket to getTable().

client.ts
import { FlightClient, pathDescriptor } from 'arrow-flight-client';

const client = new FlightClient('127.0.0.1:8815');

try {
  const info = await client.getFlightInfo(pathDescriptor('demo', 'people'));
  const ticket = info.endpoints[0]?.ticket;

  if (!ticket) {
    throw new Error('The Flight endpoint has no ticket');
  }

  const table = await client.getTable(ticket);
  console.log(table.toString());
}
finally {
  await client.close();
}

Run the example with the following command. The output contains two rows with the names Ada and Lin.

Shell
node client.ts