Table of Contents

Class FlightSqlClient

Namespace
Apache.Arrow.Flight.Sql.Client
Assembly
Apache.Arrow.Flight.Sql.dll
public class FlightSqlClient
Inheritance
FlightSqlClient
Inherited Members

Constructors

FlightSqlClient(FlightClient)

public FlightSqlClient(FlightClient client)

Parameters

client FlightClient

Methods

BeginTransactionAsync(FlightCallOptions?, CancellationToken)

Begin a new transaction.

public Task<Transaction> BeginTransactionAsync(FlightCallOptions? options = null, CancellationToken cancellationToken = default)

Parameters

options FlightCallOptions

RPC-layer hints for this call.

cancellationToken CancellationToken

Returns

Task<Transaction>

A Task representing the asynchronous operation. The task result contains the Transaction object representing the new transaction.

CancelFlightInfoAsync(FlightInfoCancelRequest, FlightCallOptions?, CancellationToken)

Explicitly cancel a FlightInfo.

public Task<FlightInfoCancelResult> CancelFlightInfoAsync(FlightInfoCancelRequest request, FlightCallOptions? options = null, CancellationToken cancellationToken = default)

Parameters

request FlightInfoCancelRequest

The CancelFlightInfoRequest.

options FlightCallOptions

RPC-layer hints for this call.

cancellationToken CancellationToken

Returns

Task<FlightInfoCancelResult>

A Task representing the asynchronous operation. The task result contains the CancelFlightInfoResult describing the canceled result.

CancelQueryAsync(FlightInfo, FlightCallOptions?, CancellationToken)

Explicitly cancel a query.

public Task<FlightInfoCancelResult> CancelQueryAsync(FlightInfo info, FlightCallOptions? options = null, CancellationToken cancellationToken = default)

Parameters

info FlightInfo

The FlightInfo of the query to cancel.

options FlightCallOptions

RPC-layer hints for this call.

cancellationToken CancellationToken

Returns

Task<FlightInfoCancelResult>

A Task representing the asynchronous operation.

CommitAsync(Transaction, FlightCallOptions?, CancellationToken)

Commit a transaction. After this, the transaction and all associated savepoints will be invalidated.

public AsyncServerStreamingCall<FlightResult> CommitAsync(Transaction transaction, FlightCallOptions? options = null, CancellationToken cancellationToken = default)

Parameters

transaction Transaction

The transaction.

options FlightCallOptions

RPC-layer hints for this call.

cancellationToken CancellationToken

Returns

AsyncServerStreamingCall<FlightResult>

A Task representing the asynchronous operation.

DoActionAsync(FlightAction, FlightCallOptions?, CancellationToken)

Perform the indicated action, returning an iterator to the stream of results, if any.

public IAsyncEnumerable<FlightResult> DoActionAsync(FlightAction action, FlightCallOptions? options = null, CancellationToken cancellationToken = default)

Parameters

action FlightAction

The action to be performed

options FlightCallOptions

Per-RPC options

cancellationToken CancellationToken

Cancellation token

Returns

IAsyncEnumerable<FlightResult>

An async enumerable of results

DoGetAsync(FlightTicket, FlightCallOptions?, CancellationToken)

Given a flight ticket and schema, request to be sent the stream. Returns record batch stream reader.

public IAsyncEnumerable<RecordBatch> DoGetAsync(FlightTicket ticket, FlightCallOptions? options = null, CancellationToken cancellationToken = default)

Parameters

ticket FlightTicket

The flight ticket to use

options FlightCallOptions

Per-RPC options

cancellationToken CancellationToken

Returns

IAsyncEnumerable<RecordBatch>

The returned RecordBatchReader

DoPutAsync(FlightDescriptor, RecordBatch, FlightCallOptions?, CancellationToken)

Upload data to a Flight described by the given descriptor. The caller must call Close() on the returned stream once they are done writing.

public Task<FlightPutResult> DoPutAsync(FlightDescriptor descriptor, RecordBatch recordBatch, FlightCallOptions? options = null, CancellationToken cancellationToken = default)

Parameters

descriptor FlightDescriptor

The descriptor of the stream.

recordBatch RecordBatch

The record for the data to upload.

options FlightCallOptions

RPC-layer hints for this call.

cancellationToken CancellationToken

Returns

Task<FlightPutResult>

A Task representing the asynchronous operation. The task result contains a DoPutResult struct holding a reader and a writer.

ExecuteAsync(string, Transaction, FlightCallOptions?, CancellationToken)

Execute a SQL query on the server.

public Task<FlightInfo> ExecuteAsync(string query, Transaction transaction = default, FlightCallOptions? options = null, CancellationToken cancellationToken = default)

Parameters

query string

The UTF8-encoded SQL query to be executed.

transaction Transaction

A transaction to associate this query with.

options FlightCallOptions

RPC-layer hints for this call.

cancellationToken CancellationToken

Cancellation token

Returns

Task<FlightInfo>

The FlightInfo describing where to access the dataset.

ExecuteUpdateAsync(string, Transaction, FlightCallOptions?, CancellationToken)

Executes an update SQL command and returns the number of affected rows.

public Task<long> ExecuteUpdateAsync(string query, Transaction transaction = default, FlightCallOptions? options = null, CancellationToken cancellationToken = default)

Parameters

query string

The UTF8-encoded SQL query to be executed.

transaction Transaction

A transaction to associate this query with. Defaults to no transaction if not provided.

options FlightCallOptions

RPC-layer hints for this call.

cancellationToken CancellationToken

Cancellation token

Returns

Task<long>

The number of rows affected by the operation.

GetCatalogsAsync(FlightCallOptions?, CancellationToken)

Request a list of catalogs.

public Task<FlightInfo> GetCatalogsAsync(FlightCallOptions? options = null, CancellationToken cancellationToken = default)

Parameters

options FlightCallOptions

RPC-layer hints for this call.

cancellationToken CancellationToken

Cancellation token

Returns

Task<FlightInfo>

The FlightInfo describing where to access the dataset.

GetCatalogsSchemaAsync(FlightCallOptions?, CancellationToken)

Get the catalogs schema from the server.

public Task<Schema> GetCatalogsSchemaAsync(FlightCallOptions? options = null, CancellationToken cancellationToken = default)

Parameters

options FlightCallOptions

RPC-layer hints for this call.

cancellationToken CancellationToken

Cancellation token

Returns

Task<Schema>

The SchemaResult describing the schema of the catalogs.

GetCrossReferenceAsync(TableRef, TableRef, FlightCallOptions?, CancellationToken)

Retrieves a description of the foreign key columns in the given foreign key table that reference the primary key or the columns representing a unique constraint of the parent table.

public Task<FlightInfo> GetCrossReferenceAsync(TableRef pkTableRef, TableRef fkTableRef, FlightCallOptions? options = null, CancellationToken cancellationToken = default)

Parameters

pkTableRef TableRef

The table reference that exports the key.

fkTableRef TableRef

The table reference that imports the key.

options FlightCallOptions

RPC-layer hints for this call.

cancellationToken CancellationToken

Returns

Task<FlightInfo>

The FlightInfo describing where to access the dataset.

GetCrossReferenceSchemaAsync(FlightCallOptions?, CancellationToken)

Get the cross-reference schema from the server.

public Task<Schema> GetCrossReferenceSchemaAsync(FlightCallOptions? options = null, CancellationToken cancellationToken = default)

Parameters

options FlightCallOptions

RPC-layer hints for this call.

cancellationToken CancellationToken

Returns

Task<Schema>

The SchemaResult describing the schema of the cross-reference.

GetDbSchemasAsync(string?, string?, FlightCallOptions?, CancellationToken)

Request a list of database schemas.

public Task<FlightInfo> GetDbSchemasAsync(string? catalog = null, string? dbSchemaFilterPattern = null, FlightCallOptions? options = null, CancellationToken cancellationToken = default)

Parameters

catalog string

The catalog.

dbSchemaFilterPattern string

The schema filter pattern.

options FlightCallOptions

RPC-layer hints for this call.

cancellationToken CancellationToken

Cancellation token

Returns

Task<FlightInfo>

The FlightInfo describing where to access the dataset.

GetDbSchemasSchemaAsync(FlightCallOptions?, CancellationToken)

Get the database schemas schema from the server.

public Task<Schema> GetDbSchemasSchemaAsync(FlightCallOptions? options = null, CancellationToken cancellationToken = default)

Parameters

options FlightCallOptions

RPC-layer hints for this call.

cancellationToken CancellationToken

Cancellation token

Returns

Task<Schema>

The SchemaResult describing the schema of the database schemas.

GetExecuteSchemaAsync(string, Transaction, FlightCallOptions?, CancellationToken)

Get the result set schema from the server for the given query.

public Task<Schema> GetExecuteSchemaAsync(string query, Transaction transaction = default, FlightCallOptions? options = null, CancellationToken cancellationToken = default)

Parameters

query string

The UTF8-encoded SQL query

transaction Transaction

A transaction to associate this query with

options FlightCallOptions

Per-RPC options

cancellationToken CancellationToken

Cancellation token

Returns

Task<Schema>

The SchemaResult describing the schema of the result set

GetExportedKeysAsync(TableRef, FlightCallOptions?, CancellationToken)

Retrieves a description about the foreign key columns that reference the primary key columns of the given table.

public Task<FlightInfo> GetExportedKeysAsync(TableRef tableRef, FlightCallOptions? options = null, CancellationToken cancellationToken = default)

Parameters

tableRef TableRef

The table reference.

options FlightCallOptions

RPC-layer hints for this call.

cancellationToken CancellationToken

Returns

Task<FlightInfo>

The FlightInfo describing where to access the dataset.

GetExportedKeysSchemaAsync(TableRef, FlightCallOptions?, CancellationToken)

Get the exported keys schema from the server.

public Task<Schema> GetExportedKeysSchemaAsync(TableRef tableRef, FlightCallOptions? options = null, CancellationToken cancellationToken = default)

Parameters

tableRef TableRef

The table reference.

options FlightCallOptions

RPC-layer hints for this call.

cancellationToken CancellationToken

Returns

Task<Schema>

The SchemaResult describing the schema of the exported keys.

GetFlightInfoAsync(FlightDescriptor, FlightCallOptions?, CancellationToken)

Asynchronously retrieves flight information for a given flight descriptor.

public Task<FlightInfo> GetFlightInfoAsync(FlightDescriptor descriptor, FlightCallOptions? options = null, CancellationToken cancellationToken = default)

Parameters

descriptor FlightDescriptor

The descriptor of the dataset request, whether a named dataset or a command.

options FlightCallOptions

RPC-layer hints for this call.

cancellationToken CancellationToken

Cancellation token

Returns

Task<FlightInfo>

A task that represents the asynchronous operation. The task result contains the FlightInfo describing where to access the dataset.

GetImportedKeysAsync(TableRef, FlightCallOptions?, CancellationToken)

Retrieves the foreign key columns for the given table.

public Task<FlightInfo> GetImportedKeysAsync(TableRef tableRef, FlightCallOptions? options = null, CancellationToken cancellationToken = default)

Parameters

tableRef TableRef

The table reference.

options FlightCallOptions

RPC-layer hints for this call.

cancellationToken CancellationToken

Returns

Task<FlightInfo>

The FlightInfo describing where to access the dataset.

GetImportedKeysSchemaAsync(FlightCallOptions?, CancellationToken)

Get the imported keys schema from the server.

public Task<Schema> GetImportedKeysSchemaAsync(FlightCallOptions? options = null, CancellationToken cancellationToken = default)

Parameters

options FlightCallOptions

RPC-layer hints for this call.

cancellationToken CancellationToken

Returns

Task<Schema>

The SchemaResult describing the schema of the imported keys.

GetPrimaryKeysAsync(TableRef, FlightCallOptions?, CancellationToken)

Request the primary keys for a table.

public Task<FlightInfo> GetPrimaryKeysAsync(TableRef tableRef, FlightCallOptions? options = null, CancellationToken cancellationToken = default)

Parameters

tableRef TableRef

The table reference.

options FlightCallOptions

RPC-layer hints for this call.

cancellationToken CancellationToken

Returns

Task<FlightInfo>

The FlightInfo describing where to access the dataset.

GetSchemaAsync(FlightDescriptor, FlightCallOptions?, CancellationToken)

Asynchronously retrieves schema information for a given flight descriptor.

public virtual Task<Schema> GetSchemaAsync(FlightDescriptor descriptor, FlightCallOptions? options = null, CancellationToken cancellationToken = default)

Parameters

descriptor FlightDescriptor

The descriptor of the dataset request, whether a named dataset or a command.

options FlightCallOptions

RPC-layer hints for this call.

cancellationToken CancellationToken

Cancellation token

Returns

Task<Schema>

A task that represents the asynchronous operation. The task result contains the SchemaResult describing the dataset schema.

GetSqlInfoAsync(List<int>?, FlightCallOptions?, CancellationToken)

Request a list of SQL information.

public Task<FlightInfo> GetSqlInfoAsync(List<int>? sqlInfo = null, FlightCallOptions? options = null, CancellationToken cancellationToken = default)

Parameters

sqlInfo List<int>

The SQL info required.

options FlightCallOptions

RPC-layer hints for this call.

cancellationToken CancellationToken

Returns

Task<FlightInfo>

The FlightInfo describing where to access the dataset.

GetSqlInfoSchemaAsync(FlightCallOptions?, CancellationToken)

Get the SQL information schema from the server.

public Task<Schema> GetSqlInfoSchemaAsync(FlightCallOptions? options = null, CancellationToken cancellationToken = default)

Parameters

options FlightCallOptions

RPC-layer hints for this call.

cancellationToken CancellationToken

Returns

Task<Schema>

The SchemaResult describing the schema of the SQL information.

GetTableTypesAsync(FlightCallOptions?, CancellationToken)

Request a list of table types.

public Task<FlightInfo> GetTableTypesAsync(FlightCallOptions? options = null, CancellationToken cancellationToken = default)

Parameters

options FlightCallOptions

RPC-layer hints for this call.

cancellationToken CancellationToken

Returns

Task<FlightInfo>

The FlightInfo describing where to access the dataset.

GetTableTypesSchemaAsync(FlightCallOptions?, CancellationToken)

Get the table types schema from the server.

public Task<Schema> GetTableTypesSchemaAsync(FlightCallOptions? options = null, CancellationToken cancellationToken = default)

Parameters

options FlightCallOptions

RPC-layer hints for this call.

cancellationToken CancellationToken

Returns

Task<Schema>

The SchemaResult describing the schema of the table types.

GetTablesAsync(string?, string?, string?, bool, IEnumerable<string>?, FlightCallOptions?, CancellationToken)

Request a list of tables.

public Task<IEnumerable<FlightInfo>> GetTablesAsync(string? catalog = null, string? dbSchemaFilterPattern = null, string? tableFilterPattern = null, bool includeSchema = false, IEnumerable<string>? tableTypes = null, FlightCallOptions? options = null, CancellationToken cancellationToken = default)

Parameters

catalog string

The catalog.

dbSchemaFilterPattern string

The schema filter pattern.

tableFilterPattern string

The table filter pattern.

includeSchema bool

True to include the schema upon return, false to not include the schema.

tableTypes IEnumerable<string>

The table types to include.

options FlightCallOptions

RPC-layer hints for this call.

cancellationToken CancellationToken

Returns

Task<IEnumerable<FlightInfo>>

The FlightInfo describing where to access the dataset.

GetXdbcTypeInfoAsync(FlightCallOptions?, CancellationToken)

Request the information about all the data types supported.

public Task<FlightInfo> GetXdbcTypeInfoAsync(FlightCallOptions? options = null, CancellationToken cancellationToken = default)

Parameters

options FlightCallOptions

RPC-layer hints for this call.

cancellationToken CancellationToken

Returns

Task<FlightInfo>

The FlightInfo describing where to access the dataset.

GetXdbcTypeInfoAsync(int, FlightCallOptions?, CancellationToken)

Request the information about all the data types supported with filtering by data type.

public Task<FlightInfo> GetXdbcTypeInfoAsync(int dataType, FlightCallOptions? options = null, CancellationToken cancellationToken = default)

Parameters

dataType int

The data type to search for as filtering.

options FlightCallOptions

RPC-layer hints for this call.

cancellationToken CancellationToken

Returns

Task<FlightInfo>

The FlightInfo describing where to access the dataset.

GetXdbcTypeInfoSchemaAsync(FlightCallOptions?, CancellationToken)

Get the type info schema from the server.

public Task<Schema> GetXdbcTypeInfoSchemaAsync(FlightCallOptions? options = null, CancellationToken cancellationToken = default)

Parameters

options FlightCallOptions

RPC-layer hints for this call.

cancellationToken CancellationToken

Returns

Task<Schema>

The SchemaResult describing the schema of the type info.

PrepareAsync(string, Transaction, FlightCallOptions?, CancellationToken)

Create a prepared statement object.

public Task<PreparedStatement> PrepareAsync(string query, Transaction transaction = default, FlightCallOptions? options = null, CancellationToken cancellationToken = default)

Parameters

query string

The query that will be executed.

transaction Transaction

A transaction to associate this query with.

options FlightCallOptions

RPC-layer hints for this call.

cancellationToken CancellationToken

Returns

Task<PreparedStatement>

The created prepared statement.

RollbackAsync(Transaction, FlightCallOptions?, CancellationToken)

Rollback a transaction. After this, the transaction and all associated savepoints will be invalidated.

public AsyncServerStreamingCall<FlightResult> RollbackAsync(Transaction transaction, FlightCallOptions? options = null, CancellationToken cancellationToken = default)

Parameters

transaction Transaction

The transaction to rollback.

options FlightCallOptions

RPC-layer hints for this call.

cancellationToken CancellationToken

Returns

AsyncServerStreamingCall<FlightResult>

A Task representing the asynchronous operation.