Arrow Flight SQL#

Common Types#

groupCommonprotocoltypesforFlightSQL

Typedefs

usingSqlInfoResult=std::variant<std::string,bool,int64_t,int32_t,std::vector<std::string>,std::unordered_map<int32_t,std::vector<int32_t>>>#

Variant supporting all possible types on SQL info.

usingSqlInfoResultMap=std::unordered_map<int32_t,SqlInfoResult>#

Map SQL info identifier to its value.

Enums

enumclassCancelResult:int8_t#

The result of cancelling a query.

Values:

enumeratorkUnspecified#
enumeratorkCancelled#
enumeratorkCancelling#
enumeratorkNotCancellable#
enumclassTableDefinitionOptionsTableNotExistOption#

The action to take if the target table of an ingestion does not exist.

Values:

enumeratorkUnspecified#
enumeratorkCreate#
enumeratorkFail#
enumclassTableDefinitionOptionsTableExistsOption#

The action to take if the target table of an ingestion already exists.

Values:

enumeratorkUnspecified#
enumeratorkFail#
enumeratorkAppend#
enumeratorkReplace#

Functions

std::ostream&operator<<(std::ostream&os,CancelResultresult)#
structSqlInfoOptions#
#include <arrow/flight/sql/types.h>

Options to be set in the SqlInfo.

Public Types

enumSqlInfo#

Predefined info values forGetSqlInfo.

Values:

enumeratorFLIGHT_SQL_SERVER_NAME#

Retrieves a UTF-8 string with the name of the Flight SQL Server.

enumeratorFLIGHT_SQL_SERVER_VERSION#

Retrieves a UTF-8 string with the native version of the Flight SQL Server.

enumeratorFLIGHT_SQL_SERVER_ARROW_VERSION#

Retrieves a UTF-8 string with the Arrow format version of the Flight SQL Server.

enumeratorFLIGHT_SQL_SERVER_READ_ONLY#

Retrieves a boolean value indicating whether the Flight SQL Server is read only.

Returns:

  • false: if read-write

  • true: if read only

enumeratorFLIGHT_SQL_SERVER_SQL#

Retrieves a boolean value indicating whether the Flight SQL Server supports executing SQL queries.

Note that the absence of this info (as opposed to a false value) does not necessarily mean that SQL is not supported, as this property was not originally defined.

enumeratorFLIGHT_SQL_SERVER_SUBSTRAIT#

Retrieves a boolean value indicating whether the Flight SQL Server supports executing Substrait plans.

enumeratorFLIGHT_SQL_SERVER_SUBSTRAIT_MIN_VERSION#

Retrieves a string value indicating the minimum supported Substrait version, or null if Substrait is not supported.

enumeratorFLIGHT_SQL_SERVER_SUBSTRAIT_MAX_VERSION#

Retrieves a string value indicating the maximum supported Substrait version, or null if Substrait is not supported.

enumeratorFLIGHT_SQL_SERVER_TRANSACTION#

Retrieves an int32 indicating whether the Flight SQL Server supports the BeginTransaction, EndTransaction, BeginSavepoint, and EndSavepoint actions.

Even if this is not supported, the database may still support explicit “BEGIN TRANSACTION”/”COMMIT” SQL statements (see SQL_TRANSACTIONS_SUPPORTED); this property is only about whether the server implements the Flight SQL API endpoints.

The possible values are listed inSqlSupportedTransaction.

enumeratorFLIGHT_SQL_SERVER_CANCEL#

Retrieves a boolean value indicating whether the Flight SQL Server supports explicit query cancellation (the CancelQuery action).

enumeratorFLIGHT_SQL_SERVER_BULK_INGESTION#

Retrieves a boolean value indicating whether the Flight SQL Server supports executing bulk ingestion.

enumeratorFLIGHT_SQL_SERVER_INGEST_TRANSACTIONS_SUPPORTED#

Retrieves a boolean value indicating whether the Flight SQL Server supports transactions for bulk ingestion.

enumeratorFLIGHT_SQL_SERVER_STATEMENT_TIMEOUT#

Retrieves an int32 value indicating the timeout (in milliseconds) for prepared statement handles.

If 0, there is no timeout.

enumeratorFLIGHT_SQL_SERVER_TRANSACTION_TIMEOUT#

Retrieves an int32 value indicating the timeout (in milliseconds) for transactions, since transactions are not tied to a connection.

If 0, there is no timeout.

enumeratorSQL_DDL_CATALOG#

Retrieves a boolean value indicating whether the Flight SQL Server supports CREATE and DROP of catalogs.

Returns:

  • false: if it doesn’t support CREATE and DROP of catalogs.

  • true: if it supports CREATE and DROP of catalogs.

enumeratorSQL_DDL_SCHEMA#

Retrieves a boolean value indicating whether the Flight SQL Server supports CREATE and DROP of schemas.

Returns:

  • false: if it doesn’t support CREATE and DROP of schemas.

  • true: if it supports CREATE and DROP of schemas.

enumeratorSQL_DDL_TABLE#

Indicates whether the Flight SQL Server supports CREATE and DROP of tables.

Returns:

  • false: if it doesn’t support CREATE and DROP of tables.

  • true: if it supports CREATE and DROP of tables.

enumeratorSQL_IDENTIFIER_CASE#

Retrieves a int32 value representing the enum ordinal for the case sensitivity of catalog, table and schema names.

The possible values are listed inarrow.flight.protocol.sql.SqlSupportedCaseSensitivity.

enumeratorSQL_IDENTIFIER_QUOTE_CHAR#

Retrieves a UTF-8 string with the supported character(s) used to surround a delimited identifier.

enumeratorSQL_QUOTED_IDENTIFIER_CASE#

Retrieves a int32 value representing the enum ordinal for the case sensitivity of quoted identifiers.

The possible values are listed inarrow.flight.protocol.sql.SqlSupportedCaseSensitivity.

enumeratorSQL_ALL_TABLES_ARE_SELECTABLE#

Retrieves a boolean value indicating whether all tables are selectable.

Returns:

  • false: if not all tables are selectable or if none are;

  • true: if all tables are selectable.

enumeratorSQL_NULL_ORDERING#

Retrieves the null ordering used by the database as a int32 ordinal value.

Returns a int32 ordinal for the null ordering being used, as described inarrow.flight.protocol.sql.SqlNullOrdering.

enumeratorSQL_KEYWORDS#

Retrieves a UTF-8 string list with values of the supported keywords.

enumeratorSQL_NUMERIC_FUNCTIONS#

Retrieves a UTF-8 string list with values of the supported numeric functions.

enumeratorSQL_STRING_FUNCTIONS#

Retrieves a UTF-8 string list with values of the supported string functions.

enumeratorSQL_SYSTEM_FUNCTIONS#

Retrieves a UTF-8 string list with values of the supported system functions.

enumeratorSQL_DATETIME_FUNCTIONS#

Retrieves a UTF-8 string list with values of the supported datetime functions.

enumeratorSQL_SEARCH_STRING_ESCAPE#

Retrieves the UTF-8 string that can be used to escape wildcard characters.

This is the string that can be used to escape ‘_’ or ‘’ in the catalog search parameters that are a pattern (and therefore use one of the wildcard characters). The ‘_’ character represents any single character; the ‘’ character represents any sequence of zero or more characters.

enumeratorSQL_EXTRA_NAME_CHARACTERS#

Retrieves a UTF-8 string with all the “extra” characters that can be used in unquoted identifier names (those beyond a-z, A-Z, 0-9 and _).

enumeratorSQL_SUPPORTS_COLUMN_ALIASING#

Retrieves a boolean value indicating whether column aliasing is supported.

If so, the SQL AS clause can be used to provide names for computed columns or to provide alias names for columns as required.

Returns:

  • false: if column aliasing is unsupported;

  • true: if column aliasing is supported.

enumeratorSQL_NULL_PLUS_NULL_IS_NULL#

Retrieves a boolean value indicating whether concatenations between null and non-null values being null are supported.

  • Returns:

  • false: if concatenations between null and non-null values being null are unsupported;

  • true: if concatenations between null and non-null values being null are supported.

enumeratorSQL_SUPPORTS_CONVERT#

Retrieves a map where the key is the type to convert from and the value is a list with the types to convert to, indicating the supported conversions.

Each key and each item on the list value is a value to a predefined type on SqlSupportsConvert enum. The returned map will be: map<int32, list<int32>>

enumeratorSQL_SUPPORTS_TABLE_CORRELATION_NAMES#

Retrieves a boolean value indicating whether, when table correlation names are supported, they are restricted to being different from the names of the tables.

Returns:

  • false: if table correlation names are unsupported;

  • true: if table correlation names are supported.

enumeratorSQL_SUPPORTS_DIFFERENT_TABLE_CORRELATION_NAMES#

Retrieves a boolean value indicating whether, when table correlation names are supported, they are restricted to being different from the names of the tables.

Returns:

  • false: if different table correlation names are unsupported;

  • true: if different table correlation names are supported

enumeratorSQL_SUPPORTS_EXPRESSIONS_IN_ORDER_BY#

Retrieves a boolean value indicating whether expressions in ORDER BY lists are supported.

Returns:

  • false: if expressions in ORDER BY are unsupported;

  • true: if expressions in ORDER BY are supported;

enumeratorSQL_SUPPORTS_ORDER_BY_UNRELATED#

Retrieves a boolean value indicating whether using a column that is not in the SELECT statement in a GROUP BY clause is supported.

Returns:

  • false: if using a column that is not in the SELECT statement in a GROUP BY clause is unsupported;

  • true: if using a column that is not in the SELECT statement in a GROUP BY clause is supported.

enumeratorSQL_SUPPORTED_GROUP_BY#

Retrieves the supported GROUP BY commands as an int32 bitmask.

The returned bitmask should be parsed in order to retrieve the supported commands.

  • return 0 (0b0) => [] (GROUP BY is unsupported);

  • return 1 (0b1) => [SQL_GROUP_BY_UNRELATED];

  • return 2 (0b10) => [SQL_GROUP_BY_BEYOND_SELECT];

  • return 3 (0b11) => [SQL_GROUP_BY_UNRELATED, SQL_GROUP_BY_BEYOND_SELECT].

Valid GROUP BY types are described underarrow.flight.protocol.sql.SqlSupportedGroupBy.

enumeratorSQL_SUPPORTS_LIKE_ESCAPE_CLAUSE#

Retrieves a boolean value indicating whether specifying a LIKE escape clause is supported.

Returns:

  • false: if specifying a LIKE escape clause is unsupported;

  • true: if specifying a LIKE escape clause is supported.

enumeratorSQL_SUPPORTS_NON_NULLABLE_COLUMNS#

Retrieves a boolean value indicating whether columns may be defined as non-nullable.

Returns:

  • false: if columns cannot be defined as non-nullable;

  • true: if columns may be defined as non-nullable.

enumeratorSQL_SUPPORTED_GRAMMAR#

Retrieves the supported SQL grammar level as per the ODBC specification.

Returns an int32 bitmask value representing the supported SQL grammar level. The returned bitmask should be parsed in order to retrieve the supported grammar levels.

For instance:

  • return 0 (0b0) => [] (SQL grammar is unsupported);

  • return 1 (0b1) => [SQL_MINIMUM_GRAMMAR];

  • return 2 (0b10) => [SQL_CORE_GRAMMAR];

  • return 3 (0b11) => [SQL_MINIMUM_GRAMMAR, SQL_CORE_GRAMMAR];

  • return 4 (0b100) => [SQL_EXTENDED_GRAMMAR];

  • return 5 (0b101) => [SQL_MINIMUM_GRAMMAR, SQL_EXTENDED_GRAMMAR];

  • return 6 (0b110) => [SQL_CORE_GRAMMAR, SQL_EXTENDED_GRAMMAR];

  • return 7 (0b111) => [SQL_MINIMUM_GRAMMAR, SQL_CORE_GRAMMAR, SQL_EXTENDED_GRAMMAR].

Valid SQL grammar levels are described underarrow.flight.protocol.sql.SupportedSqlGrammar.

enumeratorSQL_ANSI92_SUPPORTED_LEVEL#

Retrieves the supported ANSI92 SQL grammar level as per the ODBC specification.

Returns an int32 bitmask value representing the supported ANSI92 SQL grammar level. The returned bitmask should be parsed in order to retrieve the supported grammar levels.

For instance:

  • return 0 (0b0) => [] (ANSI92 SQL grammar is unsupported);

  • return 1 (0b1) => [ANSI92_ENTRY_SQL];

  • return 2 (0b10) => [ANSI92_INTERMEDIATE_SQL];

  • return 3 (0b11) => [ANSI92_ENTRY_SQL, ANSI92_INTERMEDIATE_SQL];

  • return 4 (0b100) => [ANSI92_FULL_SQL];

  • return 5 (0b101) => [ANSI92_ENTRY_SQL, ANSI92_FULL_SQL];

  • return 6 (0b110) => [ANSI92_INTERMEDIATE_SQL, ANSI92_FULL_SQL];

  • return 7 (0b111) => [ANSI92_ENTRY_SQL, ANSI92_INTERMEDIATE_SQL, ANSI92_FULL_SQL].

Valid ANSI92 SQL grammar levels are described underarrow.flight.protocol.sql.SupportedAnsi92SqlGrammarLevel.

enumeratorSQL_SUPPORTS_INTEGRITY_ENHANCEMENT_FACILITY#

Retrieves a boolean value indicating whether the SQL Integrity Enhancement Facility is supported.

Returns:

  • false: if the SQL Integrity Enhancement Facility is supported;

  • true: if the SQL Integrity Enhancement Facility is supported.

enumeratorSQL_OUTER_JOINS_SUPPORT_LEVEL#

Retrieves the support level for SQL OUTER JOINs as an int32 ordinal, as described inarrow.flight.protocol.sql.SqlOuterJoinsSupportLevel.

enumeratorSQL_SCHEMA_TERM#

Retrieves a UTF-8 string with the preferred term for “schema”.

enumeratorSQL_PROCEDURE_TERM#

Retrieves a UTF-8 string with the preferred term for “procedure”.

enumeratorSQL_CATALOG_TERM#

Retrieves a UTF-8 string with the preferred term for “catalog”.

enumeratorSQL_CATALOG_AT_START#

Retrieves a boolean value indicating whether a catalog appears at the start of a fully qualified table name.

  • false: if a catalog does not appear at the start of a fully qualified table name;

  • true: if a catalog appears at the start of a fully qualified table name.

enumeratorSQL_SCHEMAS_SUPPORTED_ACTIONS#

Retrieves the supported actions for a SQL database schema as an int32 bitmask value.

Returns an int32 bitmask value representing the supported actions for a SQL schema. The returned bitmask should be parsed in order to retrieve the supported actions for a SQL schema.

For instance:

  • return 0 (0b0) => [] (no supported actions for SQL schema);

  • return 1 (0b1) => [SQL_ELEMENT_IN_PROCEDURE_CALLS];

  • return 2 (0b10) => [SQL_ELEMENT_IN_INDEX_DEFINITIONS];

  • return 3 (0b11) => [SQL_ELEMENT_IN_PROCEDURE_CALLS, SQL_ELEMENT_IN_INDEX_DEFINITIONS];

  • return 4 (0b100) => [SQL_ELEMENT_IN_PRIVILEGE_DEFINITIONS];

  • return 5 (0b101) => [SQL_ELEMENT_IN_PROCEDURE_CALLS, SQL_ELEMENT_IN_PRIVILEGE_DEFINITIONS];

  • return 6 (0b110) => [SQL_ELEMENT_IN_INDEX_DEFINITIONS, SQL_ELEMENT_IN_PRIVILEGE_DEFINITIONS];

  • return 7 (0b111) => [SQL_ELEMENT_IN_PROCEDURE_CALLS, SQL_ELEMENT_IN_INDEX_DEFINITIONS, SQL_ELEMENT_IN_PRIVILEGE_DEFINITIONS].

Valid actions for a SQL schema described underarrow.flight.protocol.sql.SqlSupportedElementActions.

enumeratorSQL_CATALOGS_SUPPORTED_ACTIONS#

Retrieves the supported actions for a SQL catalog as an int32 bitmask value.

Returns an int32 bitmask value representing the supported actions for a SQL catalog. The returned bitmask should be parsed in order to retrieve the supported actions for a SQL catalog.

For instance:

  • return 0 (0b0) => [] (no supported actions for SQL catalog);

  • return 1 (0b1) => [SQL_ELEMENT_IN_PROCEDURE_CALLS];

  • return 2 (0b10) => [SQL_ELEMENT_IN_INDEX_DEFINITIONS];

  • return 3 (0b11) => [SQL_ELEMENT_IN_PROCEDURE_CALLS, SQL_ELEMENT_IN_INDEX_DEFINITIONS];

  • return 4 (0b100) => [SQL_ELEMENT_IN_PRIVILEGE_DEFINITIONS];

  • return 5 (0b101) => [SQL_ELEMENT_IN_PROCEDURE_CALLS, SQL_ELEMENT_IN_PRIVILEGE_DEFINITIONS];

  • return 6 (0b110) => [SQL_ELEMENT_IN_INDEX_DEFINITIONS, SQL_ELEMENT_IN_PRIVILEGE_DEFINITIONS];

  • return 7 (0b111) => [SQL_ELEMENT_IN_PROCEDURE_CALLS, SQL_ELEMENT_IN_INDEX_DEFINITIONS, SQL_ELEMENT_IN_PRIVILEGE_DEFINITIONS].

Valid actions for a SQL catalog are described underarrow.flight.protocol.sql.SqlSupportedElementActions.

enumeratorSQL_SUPPORTED_POSITIONED_COMMANDS#

Retrieves the supported SQL positioned commands as an int32 bitmask value.

Returns an int32 bitmask value representing the supported SQL positioned commands. The returned bitmask should be parsed in order to retrieve the supported SQL positioned commands.

For instance:

  • return 0 (0b0) => [] (no supported SQL positioned commands);

  • return 1 (0b1) => [SQL_POSITIONED_DELETE];

  • return 2 (0b10) => [SQL_POSITIONED_UPDATE];

  • return 3 (0b11) => [SQL_POSITIONED_DELETE, SQL_POSITIONED_UPDATE].

Valid SQL positioned commands are described underarrow.flight.protocol.sql.SqlSupportedPositionedCommands.

enumeratorSQL_SELECT_FOR_UPDATE_SUPPORTED#

Retrieves a boolean value indicating whether SELECT FOR UPDATE statements are supported.

Returns:

  • false: if SELECT FOR UPDATE statements are unsupported;

  • true: if SELECT FOR UPDATE statements are supported.

enumeratorSQL_STORED_PROCEDURES_SUPPORTED#

Retrieves a boolean value indicating whether stored procedure calls that use the stored procedure escape syntax are supported.

Returns:

  • false: if stored procedure calls that use the stored procedure escape syntax are unsupported;

  • true: if stored procedure calls that use the stored procedure escape syntax are supported.

enumeratorSQL_SUPPORTED_SUBQUERIES#

Retrieves the types of supported SQL subqueries as an int32 bitmask value.

Returns an int32 bitmask value representing the supported SQL subqueries. The returned bitmask should be parsed in order to retrieve the supported SQL subqueries.

For instance:

  • return 0 (0b0) => [] (no supported SQL subqueries);

  • return 1 (0b1) => [SQL_SUBQUERIES_IN_COMPARISONS];

  • return 2 (0b10) => [SQL_SUBQUERIES_IN_EXISTS];

  • return 3 (0b11) => [SQL_SUBQUERIES_IN_COMPARISONS, SQL_SUBQUERIES_IN_EXISTS];

  • return 4 (0b100) => [SQL_SUBQUERIES_IN_INS];

  • return 5 (0b101) => [SQL_SUBQUERIES_IN_COMPARISONS, SQL_SUBQUERIES_IN_INS];

  • return 6 (0b110) => [SQL_SUBQUERIES_IN_COMPARISONS, SQL_SUBQUERIES_IN_EXISTS];

  • return 7 (0b111) => [SQL_SUBQUERIES_IN_COMPARISONS, SQL_SUBQUERIES_IN_EXISTS, SQL_SUBQUERIES_IN_INS];

  • return 8 (0b1000) => [SQL_SUBQUERIES_IN_QUANTIFIEDS];

  • return 9 (0b1001) => [SQL_SUBQUERIES_IN_COMPARISONS, SQL_SUBQUERIES_IN_QUANTIFIEDS];

  • return 10 (0b1010) => [SQL_SUBQUERIES_IN_EXISTS, SQL_SUBQUERIES_IN_QUANTIFIEDS];

  • return 11 (0b1011) => [SQL_SUBQUERIES_IN_COMPARISONS, SQL_SUBQUERIES_IN_EXISTS, SQL_SUBQUERIES_IN_QUANTIFIEDS];

  • return 12 (0b1100) => [SQL_SUBQUERIES_IN_INS, SQL_SUBQUERIES_IN_QUANTIFIEDS];

  • return 13 (0b1101) => [SQL_SUBQUERIES_IN_COMPARISONS, SQL_SUBQUERIES_IN_INS, SQL_SUBQUERIES_IN_QUANTIFIEDS];

  • return 14 (0b1110) => [SQL_SUBQUERIES_IN_EXISTS, SQL_SUBQUERIES_IN_INS, SQL_SUBQUERIES_IN_QUANTIFIEDS];

  • return 15 (0b1111) => [SQL_SUBQUERIES_IN_COMPARISONS, SQL_SUBQUERIES_IN_EXISTS, SQL_SUBQUERIES_IN_INS, SQL_SUBQUERIES_IN_QUANTIFIEDS];

Valid SQL subqueries are described underarrow.flight.protocol.sql.SqlSupportedSubqueries.

enumeratorSQL_CORRELATED_SUBQUERIES_SUPPORTED#

Retrieves a boolean value indicating whether correlated subqueries are supported.

Returns:

  • false: if correlated subqueries are unsupported;

  • true: if correlated subqueries are supported.

enumeratorSQL_SUPPORTED_UNIONS#

Retrieves the supported SQL UNION features as an int32 bitmask value.

Returns an int32 bitmask value representing the supported SQL UNIONs. The returned bitmask should be parsed in order to retrieve the supported SQL UNIONs.

For instance:

  • return 0 (0b0) => [] (no supported SQL positioned commands);

  • return 1 (0b1) => [SQL_UNION];

  • return 2 (0b10) => [SQL_UNION_ALL];

  • return 3 (0b11) => [SQL_UNION, SQL_UNION_ALL].

Valid SQL union operators are described underarrow.flight.protocol.sql.SqlSupportedUnions.

enumeratorSQL_MAX_BINARY_LITERAL_LENGTH#

Retrieves a int64 value representing the maximum number of hex characters allowed in an inline binary literal.

enumeratorSQL_MAX_CHAR_LITERAL_LENGTH#

Retrieves a int64 value representing the maximum number of characters allowed for a character literal.

enumeratorSQL_MAX_COLUMN_NAME_LENGTH#

Retrieves a int64 value representing the maximum number of characters allowed for a column name.

enumeratorSQL_MAX_COLUMNS_IN_GROUP_BY#

Retrieves a int64 value representing the maximum number of columns allowed in a GROUP BY clause.

enumeratorSQL_MAX_COLUMNS_IN_INDEX#

Retrieves a int64 value representing the maximum number of columns allowed in an index.

enumeratorSQL_MAX_COLUMNS_IN_ORDER_BY#

Retrieves a int64 value representing the maximum number of columns allowed in an ORDER BY clause.

enumeratorSQL_MAX_COLUMNS_IN_SELECT#

Retrieves a int64 value representing the maximum number of columns allowed in a SELECT list.

enumeratorSQL_MAX_COLUMNS_IN_TABLE#

Retrieves a int64 value representing the maximum number of columns allowed in a table.

enumeratorSQL_MAX_CONNECTIONS#

Retrieves a int64 value representing the maximum number of concurrent connections possible.

enumeratorSQL_MAX_CURSOR_NAME_LENGTH#

Retrieves a int64 value the maximum number of characters allowed in a cursor name.

enumeratorSQL_MAX_INDEX_LENGTH#

Retrieves a int64 value representing the maximum number of bytes allowed for an index, including all of the parts of the index.

enumeratorSQL_SCHEMA_NAME_LENGTH#

Retrieves a int64 value representing the maximum number of characters allowed in a procedure name.

enumeratorSQL_MAX_PROCEDURE_NAME_LENGTH#

Retrieves a int64 value representing the maximum number of bytes allowed in a single row.

enumeratorSQL_MAX_CATALOG_NAME_LENGTH#

Retrieves a int64 value representing the maximum number of characters allowed in a catalog name.

enumeratorSQL_MAX_ROW_SIZE#

Retrieves a int64 value representing the maximum number of bytes allowed in a single row.

enumeratorSQL_MAX_ROW_SIZE_INCLUDES_BLOBS#

Retrieves a boolean indicating whether the return value for the JDBC method getMaxRowSize includes the SQL data types LONGVARCHAR and LONGVARBINARY.

Returns:

  • false: if return value for the JDBC method getMaxRowSize does not include the SQL data types LONGVARCHAR and LONGVARBINARY;

  • true: if return value for the JDBC method getMaxRowSize includes the SQL data types LONGVARCHAR and LONGVARBINARY.

enumeratorSQL_MAX_STATEMENT_LENGTH#

Retrieves a int32 value representing the maximum number of characters allowed for an SQL statement; a result of 0 (zero) means that there is no limit or the limit is not known.

enumeratorSQL_MAX_STATEMENTS#

Retrieves a int32 value representing the maximum number of active statements that can be open at the same time.

enumeratorSQL_MAX_TABLE_NAME_LENGTH#

Retrieves a int32 value representing the maximum number of characters allowed in a table name.

enumeratorSQL_MAX_TABLES_IN_SELECT#

Retrieves a int32 value representing the maximum number of tables allowed in a SELECT statement.

enumeratorSQL_MAX_USERNAME_LENGTH#

Retrieves a int32 value representing the maximum number of characters allowed in a user name.

enumeratorSQL_DEFAULT_TRANSACTION_ISOLATION#

Retrieves this database’s default transaction isolation level as described inarrow.flight.protocol.sql.SqlTransactionIsolationLevel.

Returns a int32 ordinal for the SQL transaction isolation level.

enumeratorSQL_TRANSACTIONS_SUPPORTED#

Retrieves a boolean value indicating whether transactions are supported.

If not, invoking the method commit is a noop, and the isolation level isarrow.flight.protocol.sql.SqlTransactionIsolationLevel.TRANSACTION_NONE.

Returns:

  • false: if transactions are unsupported;

  • true: if transactions are supported.

enumeratorSQL_SUPPORTED_TRANSACTIONS_ISOLATION_LEVELS#

Retrieves the supported transactions isolation levels, if transactions are supported.

Returns an int32 bitmask value representing the supported transactions isolation levels. The returned bitmask should be parsed in order to retrieve the supported transactions isolation levels.

For instance:

  • return 0 (0b0) => [] (no supported SQL transactions isolation levels);

  • return 1 (0b1) => [SQL_TRANSACTION_NONE];

  • return 2 (0b10) => [SQL_TRANSACTION_READ_UNCOMMITTED];

  • return 3 (0b11) => [SQL_TRANSACTION_NONE, SQL_TRANSACTION_READ_UNCOMMITTED];

  • return 4 (0b100) => [SQL_TRANSACTION_REPEATABLE_READ];

  • return 5 (0b101) => [SQL_TRANSACTION_NONE, SQL_TRANSACTION_REPEATABLE_READ];

  • return 6 (0b110) => [SQL_TRANSACTION_READ_UNCOMMITTED, SQL_TRANSACTION_REPEATABLE_READ];

  • return 7 (0b111) => [SQL_TRANSACTION_NONE, SQL_TRANSACTION_READ_UNCOMMITTED, SQL_TRANSACTION_REPEATABLE_READ];

  • return 8 (0b1000) => [SQL_TRANSACTION_REPEATABLE_READ];

  • return 9 (0b1001) => [SQL_TRANSACTION_NONE, SQL_TRANSACTION_REPEATABLE_READ];

  • return 10 (0b1010) => [SQL_TRANSACTION_READ_UNCOMMITTED, SQL_TRANSACTION_REPEATABLE_READ];

  • return 11 (0b1011) => [SQL_TRANSACTION_NONE, SQL_TRANSACTION_READ_UNCOMMITTED, SQL_TRANSACTION_REPEATABLE_READ];

  • return 12 (0b1100) => [SQL_TRANSACTION_REPEATABLE_READ, SQL_TRANSACTION_REPEATABLE_READ];

  • return 13 (0b1101) => [SQL_TRANSACTION_NONE, SQL_TRANSACTION_REPEATABLE_READ, SQL_TRANSACTION_REPEATABLE_READ];

  • return 14 (0b1110) => [SQL_TRANSACTION_READ_UNCOMMITTED, SQL_TRANSACTION_REPEATABLE_READ, SQL_TRANSACTION_REPEATABLE_READ];

  • return 15 (0b1111) => [SQL_TRANSACTION_NONE, SQL_TRANSACTION_READ_UNCOMMITTED, SQL_TRANSACTION_REPEATABLE_READ, SQL_TRANSACTION_REPEATABLE_READ];

  • return 16 (0b10000) => [SQL_TRANSACTION_SERIALIZABLE];

Valid SQL positioned commands are described underarrow.flight.protocol.sql.SqlTransactionIsolationLevel.

enumeratorSQL_DATA_DEFINITION_CAUSES_TRANSACTION_COMMIT#

Retrieves a boolean value indicating whether a data definition statement within a transaction forces the transaction to commit.

Returns:

  • false: if a data definition statement within a transaction does not force the transaction to commit;

  • true: if a data definition statement within a transaction forces the transaction to commit.

enumeratorSQL_DATA_DEFINITIONS_IN_TRANSACTIONS_IGNORED#

Retrieves a boolean value indicating whether a data definition statement within a transaction is ignored.

Returns:

  • false: if a data definition statement within a transaction is taken into account;

  • true: a data definition statement within a transaction is ignored.

enumeratorSQL_SUPPORTED_RESULT_SET_TYPES#

Retrieves an int32 bitmask value representing the supported result set types.

The returned bitmask should be parsed in order to retrieve the supported result set types.

For instance:

  • return 0 (0b0) => [] (no supported result set types);

  • return 1 (0b1) => [SQL_RESULT_SET_TYPE_UNSPECIFIED];

  • return 2 (0b10) => [SQL_RESULT_SET_TYPE_FORWARD_ONLY];

  • return 3 (0b11) => [SQL_RESULT_SET_TYPE_UNSPECIFIED, SQL_RESULT_SET_TYPE_FORWARD_ONLY];

  • return 4 (0b100) => [SQL_RESULT_SET_TYPE_SCROLL_INSENSITIVE];

  • return 5 (0b101) => [SQL_RESULT_SET_TYPE_UNSPECIFIED, SQL_RESULT_SET_TYPE_SCROLL_INSENSITIVE];

  • return 6 (0b110) => [SQL_RESULT_SET_TYPE_FORWARD_ONLY, SQL_RESULT_SET_TYPE_SCROLL_INSENSITIVE];

  • return 7 (0b111) => [SQL_RESULT_SET_TYPE_UNSPECIFIED, SQL_RESULT_SET_TYPE_FORWARD_ONLY, SQL_RESULT_SET_TYPE_SCROLL_INSENSITIVE];

  • return 8 (0b1000) => [SQL_RESULT_SET_TYPE_SCROLL_SENSITIVE];

Valid result set types are described underarrow.flight.protocol.sql.SqlSupportedResultSetType.

enumeratorSQL_SUPPORTED_CONCURRENCIES_FOR_RESULT_SET_UNSPECIFIED#

Returns an int32 bitmask value representing the concurrency types supported by the server forSqlSupportedResultSetType.SQL_RESULT_SET_TYPE_UNSPECIFIED.

For instance:

  • return 0 (0b0) => [] (no supported concurrency types for this result set type)

  • return 1 (0b1) => [SQL_RESULT_SET_CONCURRENCY_UNSPECIFIED]

  • return 2 (0b10) => [SQL_RESULT_SET_CONCURRENCY_READ_ONLY]

  • return 3 (0b11) => [SQL_RESULT_SET_CONCURRENCY_UNSPECIFIED, SQL_RESULT_SET_CONCURRENCY_READ_ONLY]

  • return 4 (0b100) => [SQL_RESULT_SET_CONCURRENCY_UPDATABLE]

  • return 5 (0b101) => [SQL_RESULT_SET_CONCURRENCY_UNSPECIFIED, SQL_RESULT_SET_CONCURRENCY_UPDATABLE]

  • return 6 (0b110) => [SQL_RESULT_SET_CONCURRENCY_READ_ONLY, SQL_RESULT_SET_CONCURRENCY_UPDATABLE]

  • return 7 (0b111) => [SQL_RESULT_SET_CONCURRENCY_UNSPECIFIED, SQL_RESULT_SET_CONCURRENCY_READ_ONLY, SQL_RESULT_SET_CONCURRENCY_UPDATABLE]

Valid result set types are described underarrow.flight.protocol.sql.SqlSupportedResultSetConcurrency.

enumeratorSQL_SUPPORTED_CONCURRENCIES_FOR_RESULT_SET_FORWARD_ONLY#

Returns an int32 bitmask value representing the concurrency types supported by the server forSqlSupportedResultSetType.SQL_RESULT_SET_TYPE_FORWARD_ONLY.

For instance:

  • return 0 (0b0) => [] (no supported concurrency types for this result set type)

  • return 1 (0b1) => [SQL_RESULT_SET_CONCURRENCY_UNSPECIFIED]

  • return 2 (0b10) => [SQL_RESULT_SET_CONCURRENCY_READ_ONLY]

  • return 3 (0b11) => [SQL_RESULT_SET_CONCURRENCY_UNSPECIFIED, SQL_RESULT_SET_CONCURRENCY_READ_ONLY]

  • return 4 (0b100) => [SQL_RESULT_SET_CONCURRENCY_UPDATABLE]

  • return 5 (0b101) => [SQL_RESULT_SET_CONCURRENCY_UNSPECIFIED, SQL_RESULT_SET_CONCURRENCY_UPDATABLE]

  • return 6 (0b110) => [SQL_RESULT_SET_CONCURRENCY_READ_ONLY, SQL_RESULT_SET_CONCURRENCY_UPDATABLE]

  • return 7 (0b111) => [SQL_RESULT_SET_CONCURRENCY_UNSPECIFIED, SQL_RESULT_SET_CONCURRENCY_READ_ONLY, SQL_RESULT_SET_CONCURRENCY_UPDATABLE]

Valid result set types are described underarrow.flight.protocol.sql.SqlSupportedResultSetConcurrency.

enumeratorSQL_SUPPORTED_CONCURRENCIES_FOR_RESULT_SET_SCROLL_SENSITIVE#

Returns an int32 bitmask value representing the concurrency types supported by the server forSqlSupportedResultSetType.SQL_RESULT_SET_TYPE_SCROLL_SENSITIVE.

For instance:

  • return 0 (0b0) => [] (no supported concurrency types for this result set type)

  • return 1 (0b1) => [SQL_RESULT_SET_CONCURRENCY_UNSPECIFIED]

  • return 2 (0b10) => [SQL_RESULT_SET_CONCURRENCY_READ_ONLY]

  • return 3 (0b11) => [SQL_RESULT_SET_CONCURRENCY_UNSPECIFIED, SQL_RESULT_SET_CONCURRENCY_READ_ONLY]

  • return 4 (0b100) => [SQL_RESULT_SET_CONCURRENCY_UPDATABLE]

  • return 5 (0b101) => [SQL_RESULT_SET_CONCURRENCY_UNSPECIFIED, SQL_RESULT_SET_CONCURRENCY_UPDATABLE]

  • return 6 (0b110) => [SQL_RESULT_SET_CONCURRENCY_READ_ONLY, SQL_RESULT_SET_CONCURRENCY_UPDATABLE]

  • return 7 (0b111) => [SQL_RESULT_SET_CONCURRENCY_UNSPECIFIED, SQL_RESULT_SET_CONCURRENCY_READ_ONLY, SQL_RESULT_SET_CONCURRENCY_UPDATABLE]

Valid result set types are described underarrow.flight.protocol.sql.SqlSupportedResultSetConcurrency.

enumeratorSQL_SUPPORTED_CONCURRENCIES_FOR_RESULT_SET_SCROLL_INSENSITIVE#

Returns an int32 bitmask value representing concurrency types supported by the server forSqlSupportedResultSetType.SQL_RESULT_SET_TYPE_SCROLL_INSENSITIVE.

For instance:

  • return 0 (0b0) => [] (no supported concurrency types for this result set type)

  • return 1 (0b1) => [SQL_RESULT_SET_CONCURRENCY_UNSPECIFIED]

  • return 2 (0b10) => [SQL_RESULT_SET_CONCURRENCY_READ_ONLY]

  • return 3 (0b11) => [SQL_RESULT_SET_CONCURRENCY_UNSPECIFIED, SQL_RESULT_SET_CONCURRENCY_READ_ONLY]

  • return 4 (0b100) => [SQL_RESULT_SET_CONCURRENCY_UPDATABLE]

  • return 5 (0b101) => [SQL_RESULT_SET_CONCURRENCY_UNSPECIFIED, SQL_RESULT_SET_CONCURRENCY_UPDATABLE]

  • return 6 (0b110) => [SQL_RESULT_SET_CONCURRENCY_READ_ONLY, SQL_RESULT_SET_CONCURRENCY_UPDATABLE]

  • return 7 (0b111) => [SQL_RESULT_SET_CONCURRENCY_UNSPECIFIED, SQL_RESULT_SET_CONCURRENCY_READ_ONLY, SQL_RESULT_SET_CONCURRENCY_UPDATABLE]

Valid result set types are described underarrow.flight.protocol.sql.SqlSupportedResultSetConcurrency.

enumeratorSQL_BATCH_UPDATES_SUPPORTED#

Retrieves a boolean value indicating whether this database supports batch updates.

-false:ifthisdatabasedoesnotsupportbatchupdates;-true:ifthisdatabasesupportsbatchupdates.
enumeratorSQL_SAVEPOINTS_SUPPORTED#

Retrieves a boolean value indicating whether this database supports savepoints.

Returns:-false:ifthisdatabasedoesnotsupportsavepoints;-true:ifthisdatabasesupportssavepoints.
enumeratorSQL_NAMED_PARAMETERS_SUPPORTED#

Retrieves a boolean value indicating whether named parameters are supported in callable statements.

Returns:

  • false: if named parameters in callable statements are unsupported;

  • true: if named parameters in callable statements are supported.

enumeratorSQL_LOCATORS_UPDATE_COPY#

Retrieves a boolean value indicating whether updates made to a LOB are made on a copy or directly to the LOB.

Returns:

  • false: if updates made to a LOB are made directly to the LOB;

  • true: if updates made to a LOB are made on a copy.

enumeratorSQL_STORED_FUNCTIONS_USING_CALL_SYNTAX_SUPPORTED#

Retrieves a boolean value indicating whether invoking user-defined or vendor functions using the stored procedure escape syntax is supported.

Returns:

  • false: if invoking user-defined or vendor functions using the stored procedure escape syntax is unsupported;

  • true: if invoking user-defined or vendor functions using the stored procedure escape syntax is supported.

enumSqlSupportedTransaction#

The level of support for Flight SQL transaction RPCs.

Values:

enumeratorSQL_SUPPORTED_TRANSACTION_NONE#

Unknown/not indicated/no support.

enumeratorSQL_SUPPORTED_TRANSACTION_TRANSACTION#

Transactions, but not savepoints.

enumeratorSQL_SUPPORTED_TRANSACTION_SAVEPOINT#

Transactions and savepoints.

enumSqlSupportedCaseSensitivity#

Indicate whether something (e.g. an identifier) is case-sensitive.

Values:

enumeratorSQL_CASE_SENSITIVITY_UNKNOWN#
enumeratorSQL_CASE_SENSITIVITY_CASE_INSENSITIVE#
enumeratorSQL_CASE_SENSITIVITY_UPPERCASE#
enumSqlNullOrdering#

Indicate how nulls are sorted.

Values:

enumeratorSQL_NULLS_SORTED_HIGH#
enumeratorSQL_NULLS_SORTED_LOW#
enumeratorSQL_NULLS_SORTED_AT_START#
enumeratorSQL_NULLS_SORTED_AT_END#
enumSqlSupportsConvert#

Type identifiers used to indicate support for converting between types.

Values:

enumeratorSQL_CONVERT_BIGINT#
enumeratorSQL_CONVERT_BINARY#
enumeratorSQL_CONVERT_BIT#
enumeratorSQL_CONVERT_CHAR#
enumeratorSQL_CONVERT_DATE#
enumeratorSQL_CONVERT_DECIMAL#
enumeratorSQL_CONVERT_FLOAT#
enumeratorSQL_CONVERT_INTEGER#
enumeratorSQL_CONVERT_INTERVAL_DAY_TIME#
enumeratorSQL_CONVERT_INTERVAL_YEAR_MONTH#
enumeratorSQL_CONVERT_LONGVARBINARY#
enumeratorSQL_CONVERT_LONGVARCHAR#
enumeratorSQL_CONVERT_NUMERIC#
enumeratorSQL_CONVERT_REAL#
enumeratorSQL_CONVERT_SMALLINT#
enumeratorSQL_CONVERT_TIME#
enumeratorSQL_CONVERT_TIMESTAMP#
enumeratorSQL_CONVERT_TINYINT#
enumeratorSQL_CONVERT_VARBINARY#
enumeratorSQL_CONVERT_VARCHAR#
structTableRef#
#include <arrow/flight/sql/types.h>

A SQL table reference, optionally containing table’s catalog and db_schema.

Public Members

std::optional<std::string>catalog#

The table’s catalog.

std::optional<std::string>db_schema#

The table’s database schema.

std::stringtable#

The table name.

structSubstraitPlan#
#include <arrow/flight/sql/types.h>

A Substrait plan to be executed, along with associated metadata.

Public Members

std::stringplan#

The serialized plan.

std::stringversion#

The Substrait release, e.g. “0.12.0”.

structTableDefinitionOptions#
#include <arrow/flight/sql/types.h>

Options for table definition behavior of bulk ingestion.

Public Members

TableDefinitionOptionsTableNotExistOptionif_not_exist#

Behavior when the table does not exist.

TableDefinitionOptionsTableExistsOptionif_exists#

Behavior when the table exists.

Client#

classFlightSqlClient#

Flight client with Flight SQL semantics.

Wraps a Flight client to provide the Flight SQL RPC calls.

Public Functions

arrow::Result<std::unique_ptr<FlightInfo>>Execute(constFlightCallOptions&options,conststd::string&query,constTransaction&transaction=no_transaction())#

Execute a SQL query on the server.

Parameters:
  • options[in] RPC-layer hints for this call.

  • query[in] The UTF8-encoded SQL query to be executed.

  • transaction[in] A transaction to associate this query with.

Returns:

TheFlightInfo describing where to access the dataset.

arrow::Result<std::unique_ptr<FlightInfo>>ExecuteSubstrait(constFlightCallOptions&options,constSubstraitPlan&plan,constTransaction&transaction=no_transaction())#

Execute a Substrait plan that returns a result set on the server.

Parameters:
  • options[in] RPC-layer hints for this call.

  • plan[in] The plan to be executed.

  • transaction[in] A transaction to associate this query with.

Returns:

TheFlightInfo describing where to access the dataset.

arrow::Result<std::unique_ptr<SchemaResult>>GetExecuteSchema(constFlightCallOptions&options,conststd::string&query,constTransaction&transaction=no_transaction())#

Get the result set schema from the server.

arrow::Result<std::unique_ptr<SchemaResult>>GetExecuteSubstraitSchema(constFlightCallOptions&options,constSubstraitPlan&plan,constTransaction&transaction=no_transaction())#

Get the result set schema from the server.

arrow::Result<int64_t>ExecuteUpdate(constFlightCallOptions&options,conststd::string&query,constTransaction&transaction=no_transaction())#

Execute an update query on the server.

Parameters:
  • options[in] RPC-layer hints for this call.

  • query[in] The UTF8-encoded SQL query to be executed.

  • transaction[in] A transaction to associate this query with.

Returns:

The quantity of rows affected by the operation.

arrow::Result<int64_t>ExecuteSubstraitUpdate(constFlightCallOptions&options,constSubstraitPlan&plan,constTransaction&transaction=no_transaction())#

Execute a Substrait plan that does not return a result set on the server.

Parameters:
  • options[in] RPC-layer hints for this call.

  • plan[in] The plan to be executed.

  • transaction[in] A transaction to associate this query with.

Returns:

TheFlightInfo describing where to access the dataset.

arrow::Result<int64_t>ExecuteIngest(constFlightCallOptions&options,conststd::shared_ptr<RecordBatchReader>&reader,constTableDefinitionOptions&table_definition_options,conststd::string&table,conststd::optional<std::string>&schema,conststd::optional<std::string>&catalog,constbooltemporary,constTransaction&transaction=no_transaction(),conststd::unordered_map<std::string,std::string>&ingest_options={})#

Execute a bulk ingestion to the server.

Parameters:
  • options[in] RPC-layer hints for this call.

  • reader[in] The records to ingest.

  • table_definition_options[in] The behavior for handling the table definition.

  • table[in] The destination table to load into.

  • schema[in] The DB schema of the destination table.

  • catalog[in] The catalog of the destination table.

  • temporary[in] Use a temporary table.

  • transaction[in] Ingest as part of this transaction.

  • ingest_options[in] Additional, backend-specific options.

Returns:

The number of rows ingested to the server.

arrow::Result<std::unique_ptr<FlightInfo>>GetCatalogs(constFlightCallOptions&options)#

Request a list of catalogs.

Parameters:

options[in] RPC-layer hints for this call.

Returns:

TheFlightInfo describing where to access the dataset.

arrow::Result<std::unique_ptr<SchemaResult>>GetCatalogsSchema(constFlightCallOptions&options)#

Get the catalogs schema from the server (should be identical toSqlSchema::GetCatalogsSchema).

arrow::Result<std::unique_ptr<FlightInfo>>GetDbSchemas(constFlightCallOptions&options,conststd::string*catalog,conststd::string*db_schema_filter_pattern)#

Request a list of database schemas.

Parameters:
  • options[in] RPC-layer hints for this call.

  • catalog[in] The catalog.

  • db_schema_filter_pattern[in] The schema filter pattern.

Returns:

TheFlightInfo describing where to access the dataset.

arrow::Result<std::unique_ptr<SchemaResult>>GetDbSchemasSchema(constFlightCallOptions&options)#

Get the database schemas schema from the server (should be identical toSqlSchema::GetDbSchemasSchema).

virtualarrow::Result<std::unique_ptr<FlightStreamReader>>DoGet(constFlightCallOptions&options,constTicket&ticket)#

Given a flight ticket and schema, request to be sent the stream.

Returns record batch stream reader

Parameters:
  • options[in] Per-RPC options

  • ticket[in] The flight ticket to use

Returns:

The returnedRecordBatchReader

arrow::Result<std::unique_ptr<FlightInfo>>GetTables(constFlightCallOptions&options,conststd::string*catalog,conststd::string*db_schema_filter_pattern,conststd::string*table_filter_pattern,boolinclude_schema,conststd::vector<std::string>*table_types)#

Request a list of tables.

Parameters:
  • options[in] RPC-layer hints for this call.

  • catalog[in] The catalog.

  • db_schema_filter_pattern[in] The schema filter pattern.

  • table_filter_pattern[in] The table filter pattern.

  • include_schema[in] True to include the schema upon return, false to not include the schema.

  • table_types[in] The table types to include.

Returns:

TheFlightInfo describing where to access the dataset.

arrow::Result<std::unique_ptr<SchemaResult>>GetTablesSchema(constFlightCallOptions&options,boolinclude_schema)#

Get the tables schema from the server (should be identical toSqlSchema::GetTablesSchema).

arrow::Result<std::unique_ptr<FlightInfo>>GetPrimaryKeys(constFlightCallOptions&options,constTableRef&table_ref)#

Request the primary keys for a table.

Parameters:
  • options[in] RPC-layer hints for this call.

  • table_ref[in] The table reference.

Returns:

TheFlightInfo describing where to access the dataset.

arrow::Result<std::unique_ptr<SchemaResult>>GetPrimaryKeysSchema(constFlightCallOptions&options)#

Get the primary keys schema from the server (should be identical toSqlSchema::GetPrimaryKeysSchema).

arrow::Result<std::unique_ptr<FlightInfo>>GetExportedKeys(constFlightCallOptions&options,constTableRef&table_ref)#

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

Parameters:
  • options[in] RPC-layer hints for this call.

  • table_ref[in] The table reference.

Returns:

TheFlightInfo describing where to access the dataset.

arrow::Result<std::unique_ptr<SchemaResult>>GetExportedKeysSchema(constFlightCallOptions&options)#

Get the exported keys schema from the server (should be identical toSqlSchema::GetExportedKeysSchema).

arrow::Result<std::unique_ptr<FlightInfo>>GetImportedKeys(constFlightCallOptions&options,constTableRef&table_ref)#

Retrieves the foreign key columns for the given table.

Parameters:
  • options[in] RPC-layer hints for this call.

  • table_ref[in] The table reference.

Returns:

TheFlightInfo describing where to access the dataset.

arrow::Result<std::unique_ptr<SchemaResult>>GetImportedKeysSchema(constFlightCallOptions&options)#

Get the imported keys schema from the server (should be identical toSqlSchema::GetImportedKeysSchema).

arrow::Result<std::unique_ptr<FlightInfo>>GetCrossReference(constFlightCallOptions&options,constTableRef&pk_table_ref,constTableRef&fk_table_ref)#

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 (could be the same or a different table).

Parameters:
  • options[in] RPC-layer hints for this call.

  • pk_table_ref[in] The table reference that exports the key.

  • fk_table_ref[in] The table reference that imports the key.

Returns:

TheFlightInfo describing where to access the dataset.

arrow::Result<std::unique_ptr<SchemaResult>>GetCrossReferenceSchema(constFlightCallOptions&options)#

Get the cross reference schema from the server (should be identical toSqlSchema::GetCrossReferenceSchema).

arrow::Result<std::unique_ptr<FlightInfo>>GetTableTypes(constFlightCallOptions&options)#

Request a list of table types.

Parameters:

options[in] RPC-layer hints for this call.

Returns:

TheFlightInfo describing where to access the dataset.

arrow::Result<std::unique_ptr<SchemaResult>>GetTableTypesSchema(constFlightCallOptions&options)#

Get the table types schema from the server (should be identical toSqlSchema::GetTableTypesSchema).

arrow::Result<std::unique_ptr<FlightInfo>>GetXdbcTypeInfo(constFlightCallOptions&options)#

Request the information about all the data types supported.

Parameters:

options[in] RPC-layer hints for this call.

Returns:

TheFlightInfo describing where to access the dataset.

arrow::Result<std::unique_ptr<FlightInfo>>GetXdbcTypeInfo(constFlightCallOptions&options,intdata_type)#

Request the information about all the data types supported.

Parameters:
  • options[in] RPC-layer hints for this call.

  • data_type[in] The data type to search for as filtering.

Returns:

TheFlightInfo describing where to access the dataset.

arrow::Result<std::unique_ptr<SchemaResult>>GetXdbcTypeInfoSchema(constFlightCallOptions&options)#

Get the type info schema from the server (should be identical toSqlSchema::GetXdbcTypeInfoSchema).

arrow::Result<std::unique_ptr<FlightInfo>>GetSqlInfo(constFlightCallOptions&options,conststd::vector<int>&sql_info)#

Request a list of SQL information.

Parameters:
  • options[in] RPC-layer hints for this call.

  • sql_info[in] the SQL info required.

Returns:

TheFlightInfo describing where to access the dataset.

arrow::Result<std::unique_ptr<SchemaResult>>GetSqlInfoSchema(constFlightCallOptions&options)#

Get the SQL information schema from the server (should be identical toSqlSchema::GetSqlInfoSchema).

arrow::Result<std::shared_ptr<PreparedStatement>>Prepare(constFlightCallOptions&options,conststd::string&query,constTransaction&transaction=no_transaction())#

Create a prepared statement object.

Parameters:
  • options[in] RPC-layer hints for this call.

  • query[in] The query that will be executed.

  • transaction[in] A transaction to associate this query with.

Returns:

The created prepared statement.

arrow::Result<std::shared_ptr<PreparedStatement>>PrepareSubstrait(constFlightCallOptions&options,constSubstraitPlan&plan,constTransaction&transaction=no_transaction())#

Create a prepared statement object.

Parameters:
  • options[in] RPC-layer hints for this call.

  • plan[in] The Substrait plan that will be executed.

  • transaction[in] A transaction to associate this query with.

Returns:

The created prepared statement.

inlinevirtualarrow::Result<std::unique_ptr<FlightInfo>>GetFlightInfo(constFlightCallOptions&options,constFlightDescriptor&descriptor)#

Call the underlying Flight client’s GetFlightInfo.

inlinevirtualarrow::Result<std::unique_ptr<SchemaResult>>GetSchema(constFlightCallOptions&options,constFlightDescriptor&descriptor)#

Call the underlying Flight client’s GetSchema.

::arrow::Result<Transaction>BeginTransaction(constFlightCallOptions&options)#

Begin a new transaction.

::arrow::Result<Savepoint>BeginSavepoint(constFlightCallOptions&options,constTransaction&transaction,conststd::string&name)#

Create a new savepoint within a transaction.

Parameters:
  • options[in] RPC-layer hints for this call.

  • transaction[in] The parent transaction.

  • name[in] A friendly name for the savepoint.

StatusCommit(constFlightCallOptions&options,constTransaction&transaction)#

Commit a transaction.

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

Parameters:
  • options[in] RPC-layer hints for this call.

  • transaction[in] The transaction.

StatusRelease(constFlightCallOptions&options,constSavepoint&savepoint)#

Release a savepoint.

After this, the savepoint (and all savepoints created after it) will be invalidated.

Parameters:
  • options[in] RPC-layer hints for this call.

  • savepoint[in] The savepoint.

StatusRollback(constFlightCallOptions&options,constTransaction&transaction)#

Rollback a transaction.

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

Parameters:
  • options[in] RPC-layer hints for this call.

  • transaction[in] The transaction.

StatusRollback(constFlightCallOptions&options,constSavepoint&savepoint)#

Rollback a savepoint.

After this, the savepoint will still be valid, but all savepoints created after it will be invalidated.

Parameters:
  • options[in] RPC-layer hints for this call.

  • savepoint[in] The savepoint.

inline::arrow::Result<CancelFlightInfoResult>CancelFlightInfo(constFlightCallOptions&options,constCancelFlightInfoRequest&request)#

Explicitly cancel aFlightInfo.

Parameters:
  • options[in] RPC-layer hints for this call.

  • request[in] The CancelFlightInfoRequest.

Returns:

Arrow result with a canceled result.

::arrow::Result<CancelResult>CancelQuery(constFlightCallOptions&options,constFlightInfo&info)#

Explicitly cancel a query.

Deprecated:

Deprecated since 13.0.0. UseCancelFlightInfo() instead. If you can assume that a server requires 13.0.0 or later, you can always useCancelFlightInfo(). Otherwise, you may need to useCancelQuery() and/orCancelFlightInfo().

Parameters:
  • options[in] RPC-layer hints for this call.

  • info[in] TheFlightInfo of the query to cancel.

inline::arrow::Result<SetSessionOptionsResult>SetSessionOptions(constFlightCallOptions&options,constSetSessionOptionsRequest&request)#

Sets session options.

Parameters:
  • options[in] RPC-layer hints for this call.

  • request[in] The session options to set.

inline::arrow::Result<GetSessionOptionsResult>GetSessionOptions(constFlightCallOptions&options,constGetSessionOptionsRequest&request)#

Gets current session options.

Parameters:
  • options[in] RPC-layer hints for this call.

  • request[in] The (empty) GetSessionOptions request object.

inline::arrow::Result<CloseSessionResult>CloseSession(constFlightCallOptions&options,constCloseSessionRequest&request)#

Explicitly closes the session if applicable.

Parameters:
  • options[in] RPC-layer hints for this call.

  • request[in] The (empty) CloseSession request object.

inline::arrow::Result<FlightEndpoint>RenewFlightEndpoint(constFlightCallOptions&options,constRenewFlightEndpointRequest&request)#

Extends the expiration of aFlightEndpoint.

Parameters:
  • options[in] RPC-layer hints for this call.

  • request[in] The RenewFlightEndpointRequest.

Returns:

Arrow result with a renewedFlightEndpoint

StatusClose()#

Explicitly shut down and clean up the client.

inline::arrow::Result<FlightClient::DoPutResult>DoPut(constFlightCallOptions&options,constFlightDescriptor&descriptor,conststd::shared_ptr<Schema>&schema)#

Wrapper aroundFlightClient::DoGet.

inline::arrow::Result<std::unique_ptr<ResultStream>>DoAction(constFlightCallOptions&options,constAction&action)#

Wrapper aroundFlightClient::DoPut.

Don’t call this directly.

classPreparedStatement#

A prepared statement that can be executed.

Public Functions

PreparedStatement(FlightSqlClient*client,std::stringhandle,std::shared_ptr<Schema>dataset_schema,std::shared_ptr<Schema>parameter_schema)#

Create a new prepared statement.

However, applications should generally useFlightSqlClient::Prepare.

Parameters:
  • client[in] Client object used to make the RPC requests.

  • handle[in] Handle for this prepared statement.

  • dataset_schema[in]Schema of the resulting dataset.

  • parameter_schema[in]Schema of the parameters (if any).

~PreparedStatement()#

Default destructor for thePreparedStatement class.

The destructor will call the Close method from the class in order, to send a request to close thePreparedStatement. NOTE: It is best to explicitly close thePreparedStatement, otherwise errors can’t be caught.

arrow::Result<std::unique_ptr<FlightInfo>>Execute(constFlightCallOptions&options={})#

Executes the prepared statement query on the server.

Returns:

AFlightInfo object representing the stream(s) to fetch.

arrow::Result<int64_t>ExecuteUpdate(constFlightCallOptions&options={})#

Executes the prepared statement update query on the server.

Returns:

The number of rows affected.

conststd::shared_ptr<Schema>&parameter_schema()const#

Retrieve the parameter schema from the query.

Returns:

The parameter schema from the query.

conststd::shared_ptr<Schema>&dataset_schema()const#

Retrieve the ResultSet schema from the query.

Returns:

The ResultSet schema from the query.

StatusSetParameters(std::shared_ptr<RecordBatch>parameter_binding)#

Set aRecordBatch that contains the parameters that will be bound.

StatusSetParameters(std::shared_ptr<RecordBatchReader>parameter_binding)#

Set aRecordBatchReader that contains the parameters that will be bound.

arrow::Result<std::unique_ptr<SchemaResult>>GetSchema(constFlightCallOptions&options={})#

Re-request the result set schema from the server (should be identical to dataset_schema).

StatusClose(constFlightCallOptions&options={})#

Close the prepared statement so the server can free up any resources.

After this, the prepared statement may not be used anymore.

boolIsClosed()const#

Check if the prepared statement is closed.

Returns:

The state of the prepared statement.

Public Static Functions

staticarrow::Result<std::shared_ptr<PreparedStatement>>ParseResponse(FlightSqlClient*client,std::unique_ptr<ResultStream>results)#

Create aPreparedStatement by parsing the server response.

Server#

classFlightSqlServerBase:publicarrow::flight::FlightServerBase#

The base class for Flight SQL servers.

Applications should subclass this class and override the virtual methods declared on this class.

Subclassed by arrow::flight::sql::example::SQLiteFlightSqlServer

Flight RPC handlers

Applications should not override these methods; they implement the Flight SQL protocol.

virtualStatusGetFlightInfo(constServerCallContext&context,constFlightDescriptor&request,std::unique_ptr<FlightInfo>*info)final#

Retrieve the schema and an access plan for the indicated descriptor.

Parameters:
  • context[in] The call context.

  • request[in] the dataset request, whether a named dataset or command

  • info[out] the returned flight info provider

Returns:

Status

virtualStatusGetSchema(constServerCallContext&context,constFlightDescriptor&request,std::unique_ptr<SchemaResult>*schema)override#

Retrieve the schema for the indicated descriptor.

Parameters:
  • context[in] The call context.

  • request[in] the dataset request, whether a named dataset or command

  • schema[out] the returned flight schema provider

Returns:

Status

virtualStatusDoGet(constServerCallContext&context,constTicket&request,std::unique_ptr<FlightDataStream>*stream)final#

Get a stream of IPC payloads to put on the wire.

Parameters:
  • context[in] The call context.

  • request[in] an opaque ticket

  • stream[out] the returned stream provider

Returns:

Status

virtualStatusDoPut(constServerCallContext&context,std::unique_ptr<FlightMessageReader>reader,std::unique_ptr<FlightMetadataWriter>writer)final#

Process a stream of IPC payloads sent from a client.

Parameters:
  • context[in] The call context.

  • reader[in] a sequence of uploaded record batches

  • writer[in] send metadata back to the client

Returns:

Status

virtualStatusListActions(constServerCallContext&context,std::vector<ActionType>*actions)final#

Retrieve the list of available actions.

Parameters:
  • context[in] The call context.

  • actions[out] a vector of available action types

Returns:

Status

virtualStatusDoAction(constServerCallContext&context,constAction&action,std::unique_ptr<ResultStream>*result)final#

Execute an action, return stream of zero or more results.

Parameters:
  • context[in] The call context.

  • action[in] the action to execute, with type and body

  • result[out] the result iterator

Returns:

Status

Flight SQL methods

Applications should override these methods to implement the Flight SQL endpoints.

virtualarrow::Result<std::unique_ptr<FlightInfo>>GetFlightInfoStatement(constServerCallContext&context,constStatementQuery&command,constFlightDescriptor&descriptor)#

Get aFlightInfo for executing a SQL query.

Parameters:
  • context[in] Per-call context.

  • command[in] TheStatementQuery object containing the SQL statement.

  • descriptor[in] The descriptor identifying the data stream.

Returns:

TheFlightInfo describing where to access the dataset.

virtualarrow::Result<std::unique_ptr<FlightInfo>>GetFlightInfoSubstraitPlan(constServerCallContext&context,constStatementSubstraitPlan&command,constFlightDescriptor&descriptor)#

Get aFlightInfo for executing a Substrait plan.

Parameters:
  • context[in] Per-call context.

  • command[in] TheStatementSubstraitPlan object containing the plan.

  • descriptor[in] The descriptor identifying the data stream.

Returns:

TheFlightInfo describing where to access the dataset.

virtualarrow::Result<std::unique_ptr<FlightDataStream>>DoGetStatement(constServerCallContext&context,constStatementQueryTicket&command)#

Get aFlightDataStream containing the query results.

Parameters:
  • context[in] Per-call context.

  • command[in] TheStatementQueryTicket containing the statement handle.

Returns:

TheFlightDataStream containing the results.

virtualarrow::Result<std::unique_ptr<FlightInfo>>GetFlightInfoPreparedStatement(constServerCallContext&context,constPreparedStatementQuery&command,constFlightDescriptor&descriptor)#

Get aFlightInfo for executing an already created prepared statement.

Parameters:
  • context[in] Per-call context.

  • command[in] ThePreparedStatementQuery object containing the prepared statement handle.

  • descriptor[in] The descriptor identifying the data stream.

Returns:

TheFlightInfo describing where to access the dataset.

virtualarrow::Result<std::unique_ptr<FlightDataStream>>DoGetPreparedStatement(constServerCallContext&context,constPreparedStatementQuery&command)#

Get aFlightDataStream containing the prepared statement query results.

Parameters:
  • context[in] Per-call context.

  • command[in] ThePreparedStatementQuery object containing the prepared statement handle.

Returns:

TheFlightDataStream containing the results.

virtualarrow::Result<std::unique_ptr<FlightInfo>>GetFlightInfoCatalogs(constServerCallContext&context,constFlightDescriptor&descriptor)#

Get aFlightInfo for listing catalogs.

Parameters:
  • context[in] Per-call context.

  • descriptor[in] The descriptor identifying the data stream.

Returns:

TheFlightInfo describing where to access the dataset.

virtualarrow::Result<std::unique_ptr<SchemaResult>>GetSchemaStatement(constServerCallContext&context,constStatementQuery&command,constFlightDescriptor&descriptor)#

Get the schema of the result set of a query.

Parameters:
  • context[in] Per-call context.

  • command[in] TheStatementQuery containing the SQL query.

  • descriptor[in] The descriptor identifying the data stream.

Returns:

The schema of the result set.

virtualarrow::Result<std::unique_ptr<SchemaResult>>GetSchemaSubstraitPlan(constServerCallContext&context,constStatementSubstraitPlan&command,constFlightDescriptor&descriptor)#

Get the schema of the result set of a Substrait plan.

Parameters:
  • context[in] Per-call context.

  • command[in] TheStatementQuery containing the plan.

  • descriptor[in] The descriptor identifying the data stream.

Returns:

The schema of the result set.

virtualarrow::Result<std::unique_ptr<SchemaResult>>GetSchemaPreparedStatement(constServerCallContext&context,constPreparedStatementQuery&command,constFlightDescriptor&descriptor)#

Get the schema of the result set of a prepared statement.

Parameters:
  • context[in] Per-call context.

  • command[in] ThePreparedStatementQuery containing the prepared statement handle.

  • descriptor[in] The descriptor identifying the data stream.

Returns:

The schema of the result set.

virtualarrow::Result<std::unique_ptr<FlightDataStream>>DoGetCatalogs(constServerCallContext&context)#

Get aFlightDataStream containing the list of catalogs.

Parameters:

context[in] Per-call context.

Returns:

An interface for sending data back to the client.

virtualarrow::Result<std::unique_ptr<FlightInfo>>GetFlightInfoXdbcTypeInfo(constServerCallContext&context,constGetXdbcTypeInfo&command,constFlightDescriptor&descriptor)#

Gets aFlightInfo for retrieving other information (See TypeInfo).

Parameters:
  • context[in] Per-call context.

  • command[in] An optional filter for on the data type.

  • descriptor[in] The descriptor identifying the data stream.

Returns:

Status.

virtualarrow::Result<std::unique_ptr<FlightDataStream>>DoGetXdbcTypeInfo(constServerCallContext&context,constGetXdbcTypeInfo&command)#

Gets aFlightDataStream containing information about the data types supported.

Parameters:
  • context[in] Per-call context.

  • command[in] TheGetXdbcTypeInfo object which may contain filter for the date type to be search for.

Returns:

Status.

virtualarrow::Result<std::unique_ptr<FlightInfo>>GetFlightInfoSqlInfo(constServerCallContext&context,constGetSqlInfo&command,constFlightDescriptor&descriptor)#

Get aFlightInfo for retrieving other information (See SqlInfo).

Parameters:
  • context[in] Per-call context.

  • command[in] TheGetSqlInfo object containing the list of SqlInfo to be returned.

  • descriptor[in] The descriptor identifying the data stream.

Returns:

TheFlightInfo describing where to access the dataset.

virtualarrow::Result<std::unique_ptr<FlightDataStream>>DoGetSqlInfo(constServerCallContext&context,constGetSqlInfo&command)#

Get aFlightDataStream containing the list of SqlInfo results.

Parameters:
  • context[in] Per-call context.

  • command[in] TheGetSqlInfo object containing the list of SqlInfo to be returned.

Returns:

TheFlightDataStream containing the results.

virtualarrow::Result<std::unique_ptr<FlightInfo>>GetFlightInfoSchemas(constServerCallContext&context,constGetDbSchemas&command,constFlightDescriptor&descriptor)#

Get aFlightInfo for listing schemas.

Parameters:
  • context[in] Per-call context.

  • command[in] TheGetDbSchemas object which may contain filters for catalog and schema name.

  • descriptor[in] The descriptor identifying the data stream.

Returns:

TheFlightInfo describing where to access the dataset.

virtualarrow::Result<std::unique_ptr<FlightDataStream>>DoGetDbSchemas(constServerCallContext&context,constGetDbSchemas&command)#

Get aFlightDataStream containing the list of schemas.

Parameters:
  • context[in] Per-call context.

  • command[in] TheGetDbSchemas object which may contain filters for catalog and schema name.

Returns:

TheFlightDataStream containing the results.

virtualarrow::Result<std::unique_ptr<FlightInfo>>GetFlightInfoTables(constServerCallContext&context,constGetTables&command,constFlightDescriptor&descriptor)#

Get aFlightInfo for listing tables.

Parameters:
  • context[in] Per-call context.

  • command[in] TheGetTables object which may contain filters for catalog, schema and table names.

  • descriptor[in] The descriptor identifying the data stream.

Returns:

TheFlightInfo describing where to access the dataset.

virtualarrow::Result<std::unique_ptr<FlightDataStream>>DoGetTables(constServerCallContext&context,constGetTables&command)#

Get aFlightDataStream containing the list of tables.

Parameters:
  • context[in] Per-call context.

  • command[in] TheGetTables object which may contain filters for catalog, schema and table names.

Returns:

TheFlightDataStream containing the results.

virtualarrow::Result<std::unique_ptr<FlightInfo>>GetFlightInfoTableTypes(constServerCallContext&context,constFlightDescriptor&descriptor)#

Get aFlightInfo to extract information about the table types.

Parameters:
  • context[in] Per-call context.

  • descriptor[in] The descriptor identifying the data stream.

Returns:

TheFlightInfo describing where to access the dataset.

virtualarrow::Result<std::unique_ptr<FlightDataStream>>DoGetTableTypes(constServerCallContext&context)#

Get aFlightDataStream containing the data related to the table types.

Parameters:

context[in] Per-call context.

Returns:

TheFlightDataStream containing the results.

virtualarrow::Result<std::unique_ptr<FlightInfo>>GetFlightInfoPrimaryKeys(constServerCallContext&context,constGetPrimaryKeys&command,constFlightDescriptor&descriptor)#

Get aFlightInfo to extract information about primary and foreign keys.

Parameters:
  • context[in] Per-call context.

  • command[in] TheGetPrimaryKeys object with necessary information to execute the request.

  • descriptor[in] The descriptor identifying the data stream.

Returns:

TheFlightInfo describing where to access the dataset.

virtualarrow::Result<std::unique_ptr<FlightDataStream>>DoGetPrimaryKeys(constServerCallContext&context,constGetPrimaryKeys&command)#

Get aFlightDataStream containing the data related to the primary and foreign keys.

Parameters:
  • context[in] Per-call context.

  • command[in] TheGetPrimaryKeys object with necessary information to execute the request.

Returns:

TheFlightDataStream containing the results.

virtualarrow::Result<std::unique_ptr<FlightInfo>>GetFlightInfoExportedKeys(constServerCallContext&context,constGetExportedKeys&command,constFlightDescriptor&descriptor)#

Get aFlightInfo to extract information about foreign and primary keys.

Parameters:
  • context[in] Per-call context.

  • command[in] TheGetExportedKeys object with necessary information to execute the request.

  • descriptor[in] The descriptor identifying the data stream.

Returns:

TheFlightInfo describing where to access the dataset.

virtualarrow::Result<std::unique_ptr<FlightDataStream>>DoGetExportedKeys(constServerCallContext&context,constGetExportedKeys&command)#

Get aFlightDataStream containing the data related to the foreign and primary keys.

Parameters:
  • context[in] Per-call context.

  • command[in] TheGetExportedKeys object with necessary information to execute the request.

Returns:

TheFlightDataStream containing the results.

virtualarrow::Result<std::unique_ptr<FlightInfo>>GetFlightInfoImportedKeys(constServerCallContext&context,constGetImportedKeys&command,constFlightDescriptor&descriptor)#

Get aFlightInfo to extract information about foreign and primary keys.

Parameters:
  • context[in] Per-call context.

  • command[in] TheGetImportedKeys object with necessary information to execute the request.

  • descriptor[in] The descriptor identifying the data stream.

Returns:

TheFlightInfo describing where to access the dataset.

virtualarrow::Result<std::unique_ptr<FlightDataStream>>DoGetImportedKeys(constServerCallContext&context,constGetImportedKeys&command)#

Get aFlightDataStream containing the data related to the foreign and primary keys.

Parameters:
  • context[in] Per-call context.

  • command[in] TheGetImportedKeys object with necessary information to execute the request.

Returns:

TheFlightDataStream containing the results.

virtualarrow::Result<std::unique_ptr<FlightInfo>>GetFlightInfoCrossReference(constServerCallContext&context,constGetCrossReference&command,constFlightDescriptor&descriptor)#

Get aFlightInfo to extract information about foreign and primary keys.

Parameters:
  • context[in] Per-call context.

  • command[in] TheGetCrossReference object with necessary information to execute the request.

  • descriptor[in] The descriptor identifying the data stream.

Returns:

TheFlightInfo describing where to access the dataset.

virtualarrow::Result<std::unique_ptr<FlightDataStream>>DoGetCrossReference(constServerCallContext&context,constGetCrossReference&command)#

Get aFlightDataStream containing the data related to the foreign and primary keys.

Parameters:
  • context[in] Per-call context.

  • command[in] TheGetCrossReference object with necessary information to execute the request.

Returns:

TheFlightDataStream containing the results.

virtualarrow::Result<int64_t>DoPutCommandStatementUpdate(constServerCallContext&context,constStatementUpdate&command)#

Execute an update SQL statement.

Parameters:
  • context[in] The call context.

  • command[in] TheStatementUpdate object containing the SQL statement.

Returns:

The changed record count.

virtualarrow::Result<int64_t>DoPutCommandSubstraitPlan(constServerCallContext&context,constStatementSubstraitPlan&command)#

Execute an update Substrait plan.

Parameters:
Returns:

The changed record count.

virtualarrow::Result<ActionCreatePreparedStatementResult>CreatePreparedStatement(constServerCallContext&context,constActionCreatePreparedStatementRequest&request)#

Create a prepared statement from a given SQL statement.

Parameters:
Returns:

AActionCreatePreparedStatementResult containing the dataset and parameter schemas and a handle for created statement.

virtualarrow::Result<ActionCreatePreparedStatementResult>CreatePreparedSubstraitPlan(constServerCallContext&context,constActionCreatePreparedSubstraitPlanRequest&request)#

Create a prepared statement from a Substrait plan.

Parameters:
Returns:

AActionCreatePreparedStatementResult containing the dataset and parameter schemas and a handle for created statement.

virtualStatusClosePreparedStatement(constServerCallContext&context,constActionClosePreparedStatementRequest&request)#

Close a prepared statement.

Parameters:
virtualStatusDoPutPreparedStatementQuery(constServerCallContext&context,constPreparedStatementQuery&command,FlightMessageReader*reader,FlightMetadataWriter*writer)#

Bind parameters to given prepared statement.

Parameters:
  • context[in] The call context.

  • command[in] ThePreparedStatementQuery object containing the prepared statement handle.

  • reader[in] A sequence of uploaded record batches.

  • writer[in] Send metadata back to the client.

virtualarrow::Result<int64_t>DoPutPreparedStatementUpdate(constServerCallContext&context,constPreparedStatementUpdate&command,FlightMessageReader*reader)#

Execute an update SQL prepared statement.

Parameters:
  • context[in] The call context.

  • command[in] ThePreparedStatementUpdate object containing the prepared statement handle.

  • reader[in] a sequence of uploaded record batches.

Returns:

The changed record count.

virtualarrow::Result<int64_t>DoPutCommandStatementIngest(constServerCallContext&context,constStatementIngest&command,FlightMessageReader*reader)#

Execute a bulk ingestion.

Parameters:
  • context[in] The call context.

  • command[in] TheStatementIngest object containing the ingestion request.

  • reader[in] a sequence of uploaded record batches.

Returns:

The changed record count.

virtualarrow::Result<ActionBeginTransactionResult>BeginTransaction(constServerCallContext&context,constActionBeginTransactionRequest&request)#

Begin a new transaction.

Parameters:
  • context[in] The call context.

  • request[in] Request parameters.

Returns:

The transaction ID.

virtualarrow::Result<ActionBeginSavepointResult>BeginSavepoint(constServerCallContext&context,constActionBeginSavepointRequest&request)#

Create a new savepoint.

Parameters:
  • context[in] The call context.

  • request[in] Request parameters.

Returns:

The savepoint ID.

virtualStatusEndSavepoint(constServerCallContext&context,constActionEndSavepointRequest&request)#

Release/rollback a savepoint.

Parameters:
  • context[in] The call context.

  • request[in] The savepoint.

virtualStatusEndTransaction(constServerCallContext&context,constActionEndTransactionRequest&request)#

Commit/rollback a transaction.

Parameters:
  • context[in] The call context.

  • request[in] The transaction.

virtualarrow::Result<CancelFlightInfoResult>CancelFlightInfo(constServerCallContext&context,constCancelFlightInfoRequest&request)#

Attempt to explicitly cancel aFlightInfo.

Parameters:
  • context[in] The call context.

  • request[in] The CancelFlightInfoRequest.

Returns:

The cancellation result.

virtualarrow::Result<SetSessionOptionsResult>SetSessionOptions(constServerCallContext&context,constSetSessionOptionsRequest&request)#

Set server session option(s).

Parameters:
  • context[in] The call context.

  • request[in] The session options to set.

virtualarrow::Result<GetSessionOptionsResult>GetSessionOptions(constServerCallContext&context,constGetSessionOptionsRequest&request)#

Get server session option(s).

Parameters:
  • context[in] The call context.

  • request[in] Request object.

virtualarrow::Result<CloseSessionResult>CloseSession(constServerCallContext&context,constCloseSessionRequest&request)#

Close/invalidate the session.

Parameters:
  • context[in] The call context.

  • request[in] Request object.

virtualarrow::Result<CancelResult>CancelQuery(constServerCallContext&context,constActionCancelQueryRequest&request)#

Attempt to explicitly cancel a query.

Deprecated:

Deprecated in 13.0.0. You just need to implementCancelFlightInfo() to support both the CancelFlightInfo action (for newer clients) and the CancelQuery action (for older clients).

Parameters:
  • context[in] The call context.

  • request[in] The query to cancel.

Returns:

The cancellation result.

virtualarrow::Result<FlightEndpoint>RenewFlightEndpoint(constServerCallContext&context,constRenewFlightEndpointRequest&request)#

Attempt to explicitly renew aFlightEndpoint.

Parameters:
  • context[in] The call context.

  • request[in] The RenewFlightEndpointRequest.

Returns:

The renew result.

Utility methods

voidRegisterSqlInfo(int32_tid,constSqlInfoResult&result)#

Register a new SqlInfo result, making it available when callingGetSqlInfo.

Parameters:
  • id[in] the SqlInfo identifier.

  • result[in] the result.

arrow::Result<std::string>arrow::flight::sql::CreateStatementQueryTicket(conststd::string&statement_handle)#

A utility function to create a ticket (a opaque binary token that the server uses to identify this query) for a statement query.

Intended for Flight SQL server implementations.

Parameters:

statement_handle[in] The statement handle that will originate the ticket.

Returns:

The parsed ticket as an string.

classSqlSchema#

Auxiliary class containing all Schemas used on Flight SQL.

Public Static Functions

staticconststd::shared_ptr<Schema>&GetCatalogsSchema()#

Get theSchema used on GetCatalogs response.

Returns:

The default schema template.

staticconststd::shared_ptr<Schema>&GetDbSchemasSchema()#

Get theSchema used onGetDbSchemas response.

Returns:

The default schema template.

staticconststd::shared_ptr<Schema>&GetTablesSchema()#

Get theSchema used onGetTables response when included schema flags is set to false.

Returns:

The default schema template.

staticconststd::shared_ptr<Schema>&GetTablesSchemaWithIncludedSchema()#

Get theSchema used onGetTables response when included schema flags is set to true.

Returns:

The default schema template.

staticconststd::shared_ptr<Schema>&GetTableTypesSchema()#

Get theSchema used on GetTableTypes response.

Returns:

The default schema template.

staticconststd::shared_ptr<Schema>&GetPrimaryKeysSchema()#

Get theSchema used onGetPrimaryKeys response when included schema flags is set to true.

Returns:

The default schema template.

staticconststd::shared_ptr<Schema>&GetExportedKeysSchema()#

Get theSchema used onGetImportedKeys response.

Returns:

The default schema template.

staticconststd::shared_ptr<Schema>&GetImportedKeysSchema()#

Get theSchema used onGetImportedKeys response.

Returns:

The default schema template.

staticconststd::shared_ptr<Schema>&GetCrossReferenceSchema()#

Get theSchema used onGetCrossReference response.

Returns:

The default schema template.

staticconststd::shared_ptr<Schema>&GetXdbcTypeInfoSchema()#

Get theSchema used onGetXdbcTypeInfo response.

Returns:

The default schema template.

staticconststd::shared_ptr<Schema>&GetSqlInfoSchema()#

Get theSchema used onGetSqlInfo response.

Returns:

The default schema template.

groupFlightSQLProtocolMessages

Simple struct wrappers for various protocol messages, used to avoid exposing Protobuf types in the API.

structStatementQuery#
#include <arrow/flight/sql/server.h>

A SQL query.

Public Members

std::stringquery#

The SQL query.

std::stringtransaction_id#

The transaction ID, if specified (else a blank string).

structStatementSubstraitPlan#
#include <arrow/flight/sql/server.h>

A Substrait plan to execute.

Public Members

SubstraitPlanplan#

The Substrait plan.

std::stringtransaction_id#

The transaction ID, if specified (else a blank string).

structStatementUpdate#
#include <arrow/flight/sql/server.h>

A SQL update query.

Public Members

std::stringquery#

The SQL query.

std::stringtransaction_id#

The transaction ID, if specified (else a blank string).

structStatementQueryTicket#
#include <arrow/flight/sql/server.h>

A request to execute a query.

Public Members

std::stringstatement_handle#

The server-generated opaque identifier for the query.

structPreparedStatementQuery#
#include <arrow/flight/sql/server.h>

A prepared query statement.

Public Members

std::stringprepared_statement_handle#

The server-generated opaque identifier for the statement.

structPreparedStatementUpdate#
#include <arrow/flight/sql/server.h>

A prepared update statement.

Public Members

std::stringprepared_statement_handle#

The server-generated opaque identifier for the statement.

structStatementIngest#
#include <arrow/flight/sql/server.h>

A bulk ingestion request.

Public Members

TableDefinitionOptionstable_definition_options#

The behavior for handling the table definition.

std::stringtable#

The destination table to load into.

std::optional<std::string>schema#

The DB schema of the destination table.

std::optional<std::string>catalog#

:

The catalog of the destination table.

booltemporary#

Use a temporary table.

std::optional<std::string>transaction_id#

Ingest as part of this transaction.

std::unordered_map<std::string,std::string>options#

Additional, backend-specific options.

structGetSqlInfo#
#include <arrow/flight/sql/server.h>

A request to fetch server metadata.

Public Members

std::vector<int32_t>info#

A list of metadata IDs to fetch.

structGetDbSchemas#
#include <arrow/flight/sql/server.h>

A request to list database schemas.

Public Members

std::optional<std::string>catalog#

An optional database catalog to filter on.

std::optional<std::string>db_schema_filter_pattern#

An optional database schema to filter on.

structGetTables#
#include <arrow/flight/sql/server.h>

A request to list database tables.

Public Members

std::optional<std::string>catalog#

An optional database catalog to filter on.

std::optional<std::string>db_schema_filter_pattern#

An optional database schema to filter on.

std::optional<std::string>table_name_filter_pattern#

An optional table name to filter on.

std::vector<std::string>table_types#

A list of table types to filter on.

boolinclude_schema#

Whether to include the Arrow schema in the response.

structGetXdbcTypeInfo#
#include <arrow/flight/sql/server.h>

A request to get SQL data type information.

Public Members

std::optional<int>data_type#

A specific SQL type ID to fetch information about.

structGetPrimaryKeys#
#include <arrow/flight/sql/server.h>

A request to list primary keys of a table.

Public Members

TableReftable_ref#

The given table.

structGetExportedKeys#
#include <arrow/flight/sql/server.h>

A request to list foreign key columns referencing primary key columns of a table.

Public Members

TableReftable_ref#

The given table.

structGetImportedKeys#
#include <arrow/flight/sql/server.h>

A request to list foreign keys of a table.

Public Members

TableReftable_ref#

The given table.

structGetCrossReference#
#include <arrow/flight/sql/server.h>

A request to list foreign key columns of a table that reference columns in a given parent table.

Public Members

TableRefpk_table_ref#

The parent table (the one containing referenced columns).

TableReffk_table_ref#

The foreign table (for which foreign key columns will be listed).

structActionBeginTransactionRequest#
#include <arrow/flight/sql/server.h>

A request to start a new transaction.

structActionBeginSavepointRequest#
#include <arrow/flight/sql/server.h>

A request to create a new savepoint.

structActionBeginSavepointResult#
#include <arrow/flight/sql/server.h>

The result of starting a new savepoint.

structActionBeginTransactionResult#
#include <arrow/flight/sql/server.h>

The result of starting a new transaction.

structActionEndSavepointRequest#
#include <arrow/flight/sql/server.h>

A request to end a savepoint.

structActionEndTransactionRequest#
#include <arrow/flight/sql/server.h>

A request to end a transaction.

structActionCancelQueryRequest#
#include <arrow/flight/sql/server.h>

An explicit request to cancel a running query.

structActionCreatePreparedStatementRequest#
#include <arrow/flight/sql/server.h>

A request to create a new prepared statement.

Public Members

std::stringquery#

The SQL query.

std::stringtransaction_id#

The transaction ID, if specified (else a blank string).

structActionCreatePreparedSubstraitPlanRequest#
#include <arrow/flight/sql/server.h>

A request to create a new prepared statement with a Substrait plan.

Public Members

SubstraitPlanplan#

The serialized Substrait plan.

std::stringtransaction_id#

The transaction ID, if specified (else a blank string).

structActionClosePreparedStatementRequest#
#include <arrow/flight/sql/server.h>

A request to close a prepared statement.

Public Members

std::stringprepared_statement_handle#

The server-generated opaque identifier for the statement.

structActionCreatePreparedStatementResult#
#include <arrow/flight/sql/server.h>

The result of creating a new prepared statement.

Public Members

std::shared_ptr<Schema>dataset_schema#

The schema of the query results, if applicable.

std::shared_ptr<Schema>parameter_schema#

The schema of the query parameters, if applicable.

std::stringprepared_statement_handle#

The server-generated opaque identifier for the statement.

On this page