Arrow Flight SQL#
Common Types#
- group flight-sql-common-types
Typedefs
-
using SqlInfoResult = 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.
-
using SqlInfoResultMap = std::unordered_map<int32_t, SqlInfoResult>#
Map SQL info identifier to its value.
Enums
-
enum class CancelResult : int8_t#
The result of cancelling a query.
Values:
-
enumerator kUnspecified#
-
enumerator kCancelled#
-
enumerator kCancelling#
-
enumerator kNotCancellable#
-
enumerator kUnspecified#
Functions
-
std::ostream &operator<<(std::ostream &os, CancelResult result)#
-
struct SqlInfoOptions#
- #include <arrow/flight/sql/types.h>
Options to be set in the SqlInfo.
Public Types
-
enum SqlInfo#
Predefined info values for GetSqlInfo.
Values:
-
enumerator FLIGHT_SQL_SERVER_NAME#
Retrieves a UTF-8 string with the name of the Flight SQL Server.
-
enumerator FLIGHT_SQL_SERVER_VERSION#
Retrieves a UTF-8 string with the native version of the Flight SQL Server.
-
enumerator FLIGHT_SQL_SERVER_ARROW_VERSION#
Retrieves a UTF-8 string with the Arrow format version of the Flight SQL Server.
-
enumerator FLIGHT_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
-
enumerator FLIGHT_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.
-
enumerator FLIGHT_SQL_SERVER_SUBSTRAIT#
Retrieves a boolean value indicating whether the Flight SQL Server supports executing Substrait plans.
-
enumerator FLIGHT_SQL_SERVER_SUBSTRAIT_MIN_VERSION#
Retrieves a string value indicating the minimum supported Substrait version, or null if Substrait is not supported.
-
enumerator FLIGHT_SQL_SERVER_SUBSTRAIT_MAX_VERSION#
Retrieves a string value indicating the maximum supported Substrait version, or null if Substrait is not supported.
-
enumerator FLIGHT_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 in
SqlSupportedTransaction
.
-
enumerator FLIGHT_SQL_SERVER_CANCEL#
Retrieves a boolean value indicating whether the Flight SQL Server supports explicit query cancellation (the CancelQuery action).
-
enumerator FLIGHT_SQL_SERVER_BULK_INGESTION#
Retrieves a boolean value indicating whether the Flight SQL Server supports executing bulk ingestion.
-
enumerator FLIGHT_SQL_SERVER_INGEST_TRANSACTIONS_SUPPORTED#
Retrieves a boolean value indicating whether the Flight SQL Server supports transactions for bulk ingestion.
-
enumerator FLIGHT_SQL_SERVER_STATEMENT_TIMEOUT#
Retrieves an int32 value indicating the timeout (in milliseconds) for prepared statement handles.
If 0, there is no timeout.
-
enumerator FLIGHT_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.
-
enumerator SQL_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.
-
enumerator SQL_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.
-
enumerator SQL_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.
-
enumerator SQL_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 in
arrow.flight.protocol.sql.SqlSupportedCaseSensitivity
.
-
enumerator SQL_IDENTIFIER_QUOTE_CHAR#
Retrieves a UTF-8 string with the supported character(s) used to surround a delimited identifier.
-
enumerator SQL_QUOTED_IDENTIFIER_CASE#
Retrieves a int32 value representing the enum ordinal for the case sensitivity of quoted identifiers.
The possible values are listed in
arrow.flight.protocol.sql.SqlSupportedCaseSensitivity
.
-
enumerator SQL_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.
-
enumerator SQL_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 in
arrow.flight.protocol.sql.SqlNullOrdering
.
-
enumerator SQL_KEYWORDS#
Retrieves a UTF-8 string list with values of the supported keywords.
-
enumerator SQL_NUMERIC_FUNCTIONS#
Retrieves a UTF-8 string list with values of the supported numeric functions.
-
enumerator SQL_STRING_FUNCTIONS#
Retrieves a UTF-8 string list with values of the supported string functions.
-
enumerator SQL_SYSTEM_FUNCTIONS#
Retrieves a UTF-8 string list with values of the supported system functions.
-
enumerator SQL_DATETIME_FUNCTIONS#
Retrieves a UTF-8 string list with values of the supported datetime functions.
-
enumerator SQL_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.
-
enumerator SQL_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 _).
-
enumerator SQL_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.
-
enumerator SQL_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.
-
enumerator SQL_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>>
-
enumerator SQL_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.
-
enumerator SQL_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
-
enumerator SQL_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;
-
enumerator SQL_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.
-
enumerator SQL_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 under
arrow.flight.protocol.sql.SqlSupportedGroupBy
.
-
enumerator SQL_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.
-
enumerator SQL_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.
-
enumerator SQL_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 under
arrow.flight.protocol.sql.SupportedSqlGrammar
.
-
enumerator SQL_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 under
arrow.flight.protocol.sql.SupportedAnsi92SqlGrammarLevel
.
-
enumerator SQL_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.
-
enumerator SQL_OUTER_JOINS_SUPPORT_LEVEL#
Retrieves the support level for SQL OUTER JOINs as an int32 ordinal, as described in
arrow.flight.protocol.sql.SqlOuterJoinsSupportLevel
.
-
enumerator SQL_SCHEMA_TERM#
Retrieves a UTF-8 string with the preferred term for “schema”.
-
enumerator SQL_PROCEDURE_TERM#
Retrieves a UTF-8 string with the preferred term for “procedure”.
-
enumerator SQL_CATALOG_TERM#
Retrieves a UTF-8 string with the preferred term for “catalog”.
-
enumerator SQL_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.
-
enumerator SQL_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 under
arrow.flight.protocol.sql.SqlSupportedElementActions
.
-
enumerator SQL_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 under
arrow.flight.protocol.sql.SqlSupportedElementActions
.
-
enumerator SQL_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 under
arrow.flight.protocol.sql.SqlSupportedPositionedCommands
.
-
enumerator SQL_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.
-
enumerator SQL_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.
-
enumerator SQL_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 under
arrow.flight.protocol.sql.SqlSupportedSubqueries
.
-
enumerator SQL_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.
-
enumerator SQL_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 under
arrow.flight.protocol.sql.SqlSupportedUnions
.
-
enumerator SQL_MAX_BINARY_LITERAL_LENGTH#
Retrieves a int64 value representing the maximum number of hex characters allowed in an inline binary literal.
-
enumerator SQL_MAX_CHAR_LITERAL_LENGTH#
Retrieves a int64 value representing the maximum number of characters allowed for a character literal.
-
enumerator SQL_MAX_COLUMN_NAME_LENGTH#
Retrieves a int64 value representing the maximum number of characters allowed for a column name.
-
enumerator SQL_MAX_COLUMNS_IN_GROUP_BY#
Retrieves a int64 value representing the maximum number of columns allowed in a GROUP BY clause.
-
enumerator SQL_MAX_COLUMNS_IN_INDEX#
Retrieves a int64 value representing the maximum number of columns allowed in an index.
-
enumerator SQL_MAX_COLUMNS_IN_ORDER_BY#
Retrieves a int64 value representing the maximum number of columns allowed in an ORDER BY clause.
-
enumerator SQL_MAX_COLUMNS_IN_SELECT#
Retrieves a int64 value representing the maximum number of columns allowed in a SELECT list.
-
enumerator SQL_MAX_COLUMNS_IN_TABLE#
Retrieves a int64 value representing the maximum number of columns allowed in a table.
-
enumerator SQL_MAX_CONNECTIONS#
Retrieves a int64 value representing the maximum number of concurrent connections possible.
-
enumerator SQL_MAX_CURSOR_NAME_LENGTH#
Retrieves a int64 value the maximum number of characters allowed in a cursor name.
-
enumerator SQL_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.
-
enumerator SQL_SCHEMA_NAME_LENGTH#
Retrieves a int64 value representing the maximum number of characters allowed in a procedure name.
-
enumerator SQL_MAX_PROCEDURE_NAME_LENGTH#
Retrieves a int64 value representing the maximum number of bytes allowed in a single row.
-
enumerator SQL_MAX_CATALOG_NAME_LENGTH#
Retrieves a int64 value representing the maximum number of characters allowed in a catalog name.
-
enumerator SQL_MAX_ROW_SIZE#
Retrieves a int64 value representing the maximum number of bytes allowed in a single row.
-
enumerator SQL_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.
-
enumerator SQL_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.
-
enumerator SQL_MAX_STATEMENTS#
Retrieves a int32 value representing the maximum number of active statements that can be open at the same time.
-
enumerator SQL_MAX_TABLE_NAME_LENGTH#
Retrieves a int32 value representing the maximum number of characters allowed in a table name.
-
enumerator SQL_MAX_TABLES_IN_SELECT#
Retrieves a int32 value representing the maximum number of tables allowed in a SELECT statement.
-
enumerator SQL_MAX_USERNAME_LENGTH#
Retrieves a int32 value representing the maximum number of characters allowed in a user name.
-
enumerator SQL_DEFAULT_TRANSACTION_ISOLATION#
Retrieves this database’s default transaction isolation level as described in
arrow.flight.protocol.sql.SqlTransactionIsolationLevel
.Returns a int32 ordinal for the SQL transaction isolation level.
-
enumerator SQL_TRANSACTIONS_SUPPORTED#
Retrieves a boolean value indicating whether transactions are supported.
If not, invoking the method commit is a noop, and the isolation level is
arrow.flight.protocol.sql.SqlTransactionIsolationLevel.TRANSACTION_NONE
.Returns:
false: if transactions are unsupported;
true: if transactions are supported.
-
enumerator SQL_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 under
arrow.flight.protocol.sql.SqlTransactionIsolationLevel
.
-
enumerator SQL_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.
-
enumerator SQL_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.
-
enumerator SQL_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 under
arrow.flight.protocol.sql.SqlSupportedResultSetType
.
-
enumerator SQL_SUPPORTED_CONCURRENCIES_FOR_RESULT_SET_UNSPECIFIED#
Returns an int32 bitmask value representing the concurrency types supported by the server for
SqlSupportedResultSetType.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 under
arrow.flight.protocol.sql.SqlSupportedResultSetConcurrency
.
-
enumerator SQL_SUPPORTED_CONCURRENCIES_FOR_RESULT_SET_FORWARD_ONLY#
Returns an int32 bitmask value representing the concurrency types supported by the server for
SqlSupportedResultSetType.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 under
arrow.flight.protocol.sql.SqlSupportedResultSetConcurrency
.
-
enumerator SQL_SUPPORTED_CONCURRENCIES_FOR_RESULT_SET_SCROLL_SENSITIVE#
Returns an int32 bitmask value representing the concurrency types supported by the server for
SqlSupportedResultSetType.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 under
arrow.flight.protocol.sql.SqlSupportedResultSetConcurrency
.
-
enumerator SQL_SUPPORTED_CONCURRENCIES_FOR_RESULT_SET_SCROLL_INSENSITIVE#
Returns an int32 bitmask value representing concurrency types supported by the server for
SqlSupportedResultSetType.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 under
arrow.flight.protocol.sql.SqlSupportedResultSetConcurrency
.
-
enumerator SQL_BATCH_UPDATES_SUPPORTED#
Retrieves a boolean value indicating whether this database supports batch updates.
- false: if this database does not support batch updates; - true: if this database supports batch updates.
-
enumerator SQL_SAVEPOINTS_SUPPORTED#
Retrieves a boolean value indicating whether this database supports savepoints.
Returns: - false: if this database does not support savepoints; - true: if this database supports savepoints.
-
enumerator SQL_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.
-
enumerator SQL_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.
-
enumerator SQL_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.
-
enumerator FLIGHT_SQL_SERVER_NAME#
-
enum SqlSupportedTransaction#
The level of support for Flight SQL transaction RPCs.
Values:
-
enumerator SQL_SUPPORTED_TRANSACTION_NONE#
Unknown/not indicated/no support.
-
enumerator SQL_SUPPORTED_TRANSACTION_TRANSACTION#
Transactions, but not savepoints.
-
enumerator SQL_SUPPORTED_TRANSACTION_SAVEPOINT#
Transactions and savepoints.
-
enumerator SQL_SUPPORTED_TRANSACTION_NONE#
-
enum SqlSupportedCaseSensitivity#
Indicate whether something (e.g. an identifier) is case-sensitive.
Values:
-
enumerator SQL_CASE_SENSITIVITY_UNKNOWN#
-
enumerator SQL_CASE_SENSITIVITY_CASE_INSENSITIVE#
-
enumerator SQL_CASE_SENSITIVITY_UPPERCASE#
-
enumerator SQL_CASE_SENSITIVITY_UNKNOWN#
-
enum SqlNullOrdering#
Indicate how nulls are sorted.
Values:
-
enumerator SQL_NULLS_SORTED_HIGH#
-
enumerator SQL_NULLS_SORTED_LOW#
-
enumerator SQL_NULLS_SORTED_AT_START#
-
enumerator SQL_NULLS_SORTED_AT_END#
-
enumerator SQL_NULLS_SORTED_HIGH#
-
enum SqlSupportsConvert#
Type identifiers used to indicate support for converting between types.
Values:
-
enumerator SQL_CONVERT_BIGINT#
-
enumerator SQL_CONVERT_BINARY#
-
enumerator SQL_CONVERT_BIT#
-
enumerator SQL_CONVERT_CHAR#
-
enumerator SQL_CONVERT_DATE#
-
enumerator SQL_CONVERT_DECIMAL#
-
enumerator SQL_CONVERT_FLOAT#
-
enumerator SQL_CONVERT_INTEGER#
-
enumerator SQL_CONVERT_INTERVAL_DAY_TIME#
-
enumerator SQL_CONVERT_INTERVAL_YEAR_MONTH#
-
enumerator SQL_CONVERT_LONGVARBINARY#
-
enumerator SQL_CONVERT_LONGVARCHAR#
-
enumerator SQL_CONVERT_NUMERIC#
-
enumerator SQL_CONVERT_REAL#
-
enumerator SQL_CONVERT_SMALLINT#
-
enumerator SQL_CONVERT_TIME#
-
enumerator SQL_CONVERT_TIMESTAMP#
-
enumerator SQL_CONVERT_TINYINT#
-
enumerator SQL_CONVERT_VARBINARY#
-
enumerator SQL_CONVERT_VARCHAR#
-
enumerator SQL_CONVERT_BIGINT#
-
enum SqlInfo#
-
struct TableRef#
- #include <arrow/flight/sql/types.h>
A SQL table reference, optionally containing table’s catalog and db_schema.
-
struct SubstraitPlan#
- #include <arrow/flight/sql/types.h>
A Substrait plan to be executed, along with associated metadata.
-
struct TableDefinitionOptions#
- #include <arrow/flight/sql/types.h>
Options for table definition behavior of bulk ingestion.
Public Members
-
TableDefinitionOptionsTableNotExistOption if_not_exist#
Behavior when the table does not exist.
-
TableDefinitionOptionsTableExistsOption if_exists#
Behavior when the table exists.
-
TableDefinitionOptionsTableNotExistOption if_not_exist#
-
using SqlInfoResult = std::variant<std::string, bool, int64_t, int32_t, std::vector<std::string>, std::unordered_map<int32_t, std::vector<int32_t>>>#
Client#
-
class FlightSqlClient#
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(const FlightCallOptions &options, const std::string &query, const Transaction &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:
The FlightInfo describing where to access the dataset.
-
arrow::Result<std::unique_ptr<FlightInfo>> ExecuteSubstrait(const FlightCallOptions &options, const SubstraitPlan &plan, const Transaction &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:
The FlightInfo describing where to access the dataset.
-
arrow::Result<std::unique_ptr<SchemaResult>> GetExecuteSchema(const FlightCallOptions &options, const std::string &query, const Transaction &transaction = no_transaction())#
Get the result set schema from the server.
-
arrow::Result<std::unique_ptr<SchemaResult>> GetExecuteSubstraitSchema(const FlightCallOptions &options, const SubstraitPlan &plan, const Transaction &transaction = no_transaction())#
Get the result set schema from the server.
-
arrow::Result<int64_t> ExecuteUpdate(const FlightCallOptions &options, const std::string &query, const Transaction &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(const FlightCallOptions &options, const SubstraitPlan &plan, const Transaction &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:
The FlightInfo describing where to access the dataset.
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(const FlightCallOptions &options)#
Request a list of catalogs.
- Parameters:
options – [in] RPC-layer hints for this call.
- Returns:
The FlightInfo describing where to access the dataset.
-
arrow::Result<std::unique_ptr<SchemaResult>> GetCatalogsSchema(const FlightCallOptions &options)#
Get the catalogs schema from the server (should be identical to SqlSchema::GetCatalogsSchema).
-
arrow::Result<std::unique_ptr<FlightInfo>> GetDbSchemas(const FlightCallOptions &options, const std::string *catalog, const std::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:
The FlightInfo describing where to access the dataset.
-
arrow::Result<std::unique_ptr<SchemaResult>> GetDbSchemasSchema(const FlightCallOptions &options)#
Get the database schemas schema from the server (should be identical to SqlSchema::GetDbSchemasSchema).
-
virtual arrow::Result<std::unique_ptr<FlightStreamReader>> DoGet(const FlightCallOptions &options, const Ticket &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 returned RecordBatchReader
-
arrow::Result<std::unique_ptr<FlightInfo>> GetTables(const FlightCallOptions &options, const std::string *catalog, const std::string *db_schema_filter_pattern, const std::string *table_filter_pattern, bool include_schema, const std::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:
The FlightInfo describing where to access the dataset.
-
arrow::Result<std::unique_ptr<SchemaResult>> GetTablesSchema(const FlightCallOptions &options, bool include_schema)#
Get the tables schema from the server (should be identical to SqlSchema::GetTablesSchema).
-
arrow::Result<std::unique_ptr<FlightInfo>> GetPrimaryKeys(const FlightCallOptions &options, const TableRef &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:
The FlightInfo describing where to access the dataset.
-
arrow::Result<std::unique_ptr<SchemaResult>> GetPrimaryKeysSchema(const FlightCallOptions &options)#
Get the primary keys schema from the server (should be identical to SqlSchema::GetPrimaryKeysSchema).
-
arrow::Result<std::unique_ptr<FlightInfo>> GetExportedKeys(const FlightCallOptions &options, const TableRef &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:
The FlightInfo describing where to access the dataset.
-
arrow::Result<std::unique_ptr<SchemaResult>> GetExportedKeysSchema(const FlightCallOptions &options)#
Get the exported keys schema from the server (should be identical to SqlSchema::GetExportedKeysSchema).
-
arrow::Result<std::unique_ptr<FlightInfo>> GetImportedKeys(const FlightCallOptions &options, const TableRef &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:
The FlightInfo describing where to access the dataset.
-
arrow::Result<std::unique_ptr<SchemaResult>> GetImportedKeysSchema(const FlightCallOptions &options)#
Get the imported keys schema from the server (should be identical to SqlSchema::GetImportedKeysSchema).
-
arrow::Result<std::unique_ptr<FlightInfo>> GetCrossReference(const FlightCallOptions &options, const TableRef &pk_table_ref, const TableRef &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:
The FlightInfo describing where to access the dataset.
-
arrow::Result<std::unique_ptr<SchemaResult>> GetCrossReferenceSchema(const FlightCallOptions &options)#
Get the cross reference schema from the server (should be identical to SqlSchema::GetCrossReferenceSchema).
-
arrow::Result<std::unique_ptr<FlightInfo>> GetTableTypes(const FlightCallOptions &options)#
Request a list of table types.
- Parameters:
options – [in] RPC-layer hints for this call.
- Returns:
The FlightInfo describing where to access the dataset.
-
arrow::Result<std::unique_ptr<SchemaResult>> GetTableTypesSchema(const FlightCallOptions &options)#
Get the table types schema from the server (should be identical to SqlSchema::GetTableTypesSchema).
-
arrow::Result<std::unique_ptr<FlightInfo>> GetXdbcTypeInfo(const FlightCallOptions &options)#
Request the information about all the data types supported.
- Parameters:
options – [in] RPC-layer hints for this call.
- Returns:
The FlightInfo describing where to access the dataset.
-
arrow::Result<std::unique_ptr<FlightInfo>> GetXdbcTypeInfo(const FlightCallOptions &options, int data_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:
The FlightInfo describing where to access the dataset.
-
arrow::Result<std::unique_ptr<SchemaResult>> GetXdbcTypeInfoSchema(const FlightCallOptions &options)#
Get the type info schema from the server (should be identical to SqlSchema::GetXdbcTypeInfoSchema).
-
arrow::Result<std::unique_ptr<FlightInfo>> GetSqlInfo(const FlightCallOptions &options, const std::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:
The FlightInfo describing where to access the dataset.
-
arrow::Result<std::unique_ptr<SchemaResult>> GetSqlInfoSchema(const FlightCallOptions &options)#
Get the SQL information schema from the server (should be identical to SqlSchema::GetSqlInfoSchema).
-
arrow::Result<std::shared_ptr<PreparedStatement>> Prepare(const FlightCallOptions &options, const std::string &query, const Transaction &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(const FlightCallOptions &options, const SubstraitPlan &plan, const Transaction &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.
-
inline virtual arrow::Result<std::unique_ptr<FlightInfo>> GetFlightInfo(const FlightCallOptions &options, const FlightDescriptor &descriptor)#
Call the underlying Flight client’s GetFlightInfo.
-
inline virtual arrow::Result<std::unique_ptr<SchemaResult>> GetSchema(const FlightCallOptions &options, const FlightDescriptor &descriptor)#
Call the underlying Flight client’s GetSchema.
-
::arrow::Result<Transaction> BeginTransaction(const FlightCallOptions &options)#
Begin a new transaction.
-
::arrow::Result<Savepoint> BeginSavepoint(const FlightCallOptions &options, const Transaction &transaction, const std::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.
-
Status Commit(const FlightCallOptions &options, const Transaction &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.
-
Status Release(const FlightCallOptions &options, const Savepoint &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.
-
Status Rollback(const FlightCallOptions &options, const Transaction &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.
-
Status Rollback(const FlightCallOptions &options, const Savepoint &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(const FlightCallOptions &options, const CancelFlightInfoRequest &request)#
Explicitly cancel a FlightInfo.
- Parameters:
options – [in] RPC-layer hints for this call.
request – [in] The CancelFlightInfoRequest.
- Returns:
Arrow result with a canceled result.
-
::arrow::Result<CancelResult> CancelQuery(const FlightCallOptions &options, const FlightInfo &info)#
Explicitly cancel a query.
- Deprecated:
Deprecated since 13.0.0. Use CancelFlightInfo() instead. If you can assume that a server requires 13.0.0 or later, you can always use CancelFlightInfo(). Otherwise, you may need to use CancelQuery() and/or CancelFlightInfo().
- Parameters:
options – [in] RPC-layer hints for this call.
info – [in] The FlightInfo of the query to cancel.
-
inline ::arrow::Result<SetSessionOptionsResult> SetSessionOptions(const FlightCallOptions &options, const SetSessionOptionsRequest &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(const FlightCallOptions &options, const GetSessionOptionsRequest &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(const FlightCallOptions &options, const CloseSessionRequest &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(const FlightCallOptions &options, const RenewFlightEndpointRequest &request)#
Extends the expiration of a FlightEndpoint.
- Parameters:
options – [in] RPC-layer hints for this call.
request – [in] The RenewFlightEndpointRequest.
- Returns:
Arrow result with a renewed FlightEndpoint
Wrapper around FlightClient::DoGet.
-
inline ::arrow::Result<std::unique_ptr<ResultStream>> DoAction(const FlightCallOptions &options, const Action &action)#
Wrapper around FlightClient::DoPut.
Don’t call this directly.
-
arrow::Result<std::unique_ptr<FlightInfo>> Execute(const FlightCallOptions &options, const std::string &query, const Transaction &transaction = no_transaction())#
-
class PreparedStatement#
A prepared statement that can be executed.
Public Functions
Create a new prepared statement.
However, applications should generally use FlightSqlClient::Prepare.
-
~PreparedStatement()#
Default destructor for the PreparedStatement class.
The destructor will call the Close method from the class in order, to send a request to close the PreparedStatement. NOTE: It is best to explicitly close the PreparedStatement, otherwise errors can’t be caught.
-
arrow::Result<std::unique_ptr<FlightInfo>> Execute(const FlightCallOptions &options = {})#
Executes the prepared statement query on the server.
- Returns:
A FlightInfo object representing the stream(s) to fetch.
-
arrow::Result<int64_t> ExecuteUpdate(const FlightCallOptions &options = {})#
Executes the prepared statement update query on the server.
- Returns:
The number of rows affected.
-
const std::shared_ptr<Schema> ¶meter_schema() const#
Retrieve the parameter schema from the query.
- Returns:
The parameter schema from the query.
-
const std::shared_ptr<Schema> &dataset_schema() const#
Retrieve the ResultSet schema from the query.
- Returns:
The ResultSet schema from the query.
Set a RecordBatch that contains the parameters that will be bound.
Set a RecordBatchReader that contains the parameters that will be bound.
-
arrow::Result<std::unique_ptr<SchemaResult>> GetSchema(const FlightCallOptions &options = {})#
Re-request the result set schema from the server (should be identical to dataset_schema).
-
Status Close(const FlightCallOptions &options = {})#
Close the prepared statement so the server can free up any resources.
After this, the prepared statement may not be used anymore.
-
bool IsClosed() const#
Check if the prepared statement is closed.
- Returns:
The state of the prepared statement.
Public Static Functions
-
static arrow::Result<std::shared_ptr<PreparedStatement>> ParseResponse(FlightSqlClient *client, std::unique_ptr<ResultStream> results)#
Create a PreparedStatement by parsing the server response.
Server#
-
class FlightSqlServerBase : public arrow::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.
-
virtual Status GetFlightInfo(const ServerCallContext &context, const FlightDescriptor &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:
-
virtual Status GetSchema(const ServerCallContext &context, const FlightDescriptor &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:
-
virtual Status DoGet(const ServerCallContext &context, const Ticket &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:
-
virtual Status DoPut(const ServerCallContext &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:
-
virtual Status ListActions(const ServerCallContext &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:
-
virtual Status DoAction(const ServerCallContext &context, const Action &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:
Flight SQL methods
Applications should override these methods to implement the Flight SQL endpoints.
-
virtual arrow::Result<std::unique_ptr<FlightInfo>> GetFlightInfoStatement(const ServerCallContext &context, const StatementQuery &command, const FlightDescriptor &descriptor)#
Get a FlightInfo for executing a SQL query.
- Parameters:
context – [in] Per-call context.
command – [in] The StatementQuery object containing the SQL statement.
descriptor – [in] The descriptor identifying the data stream.
- Returns:
The FlightInfo describing where to access the dataset.
-
virtual arrow::Result<std::unique_ptr<FlightInfo>> GetFlightInfoSubstraitPlan(const ServerCallContext &context, const StatementSubstraitPlan &command, const FlightDescriptor &descriptor)#
Get a FlightInfo for executing a Substrait plan.
- Parameters:
context – [in] Per-call context.
command – [in] The StatementSubstraitPlan object containing the plan.
descriptor – [in] The descriptor identifying the data stream.
- Returns:
The FlightInfo describing where to access the dataset.
-
virtual arrow::Result<std::unique_ptr<FlightDataStream>> DoGetStatement(const ServerCallContext &context, const StatementQueryTicket &command)#
Get a FlightDataStream containing the query results.
- Parameters:
context – [in] Per-call context.
command – [in] The StatementQueryTicket containing the statement handle.
- Returns:
The FlightDataStream containing the results.
-
virtual arrow::Result<std::unique_ptr<FlightInfo>> GetFlightInfoPreparedStatement(const ServerCallContext &context, const PreparedStatementQuery &command, const FlightDescriptor &descriptor)#
Get a FlightInfo for executing an already created prepared statement.
- Parameters:
context – [in] Per-call context.
command – [in] The PreparedStatementQuery object containing the prepared statement handle.
descriptor – [in] The descriptor identifying the data stream.
- Returns:
The FlightInfo describing where to access the dataset.
-
virtual arrow::Result<std::unique_ptr<FlightDataStream>> DoGetPreparedStatement(const ServerCallContext &context, const PreparedStatementQuery &command)#
Get a FlightDataStream containing the prepared statement query results.
- Parameters:
context – [in] Per-call context.
command – [in] The PreparedStatementQuery object containing the prepared statement handle.
- Returns:
The FlightDataStream containing the results.
-
virtual arrow::Result<std::unique_ptr<FlightInfo>> GetFlightInfoCatalogs(const ServerCallContext &context, const FlightDescriptor &descriptor)#
Get a FlightInfo for listing catalogs.
- Parameters:
context – [in] Per-call context.
descriptor – [in] The descriptor identifying the data stream.
- Returns:
The FlightInfo describing where to access the dataset.
-
virtual arrow::Result<std::unique_ptr<SchemaResult>> GetSchemaStatement(const ServerCallContext &context, const StatementQuery &command, const FlightDescriptor &descriptor)#
Get the schema of the result set of a query.
- Parameters:
context – [in] Per-call context.
command – [in] The StatementQuery containing the SQL query.
descriptor – [in] The descriptor identifying the data stream.
- Returns:
The schema of the result set.
-
virtual arrow::Result<std::unique_ptr<SchemaResult>> GetSchemaSubstraitPlan(const ServerCallContext &context, const StatementSubstraitPlan &command, const FlightDescriptor &descriptor)#
Get the schema of the result set of a Substrait plan.
- Parameters:
context – [in] Per-call context.
command – [in] The StatementQuery containing the plan.
descriptor – [in] The descriptor identifying the data stream.
- Returns:
The schema of the result set.
-
virtual arrow::Result<std::unique_ptr<SchemaResult>> GetSchemaPreparedStatement(const ServerCallContext &context, const PreparedStatementQuery &command, const FlightDescriptor &descriptor)#
Get the schema of the result set of a prepared statement.
- Parameters:
context – [in] Per-call context.
command – [in] The PreparedStatementQuery containing the prepared statement handle.
descriptor – [in] The descriptor identifying the data stream.
- Returns:
The schema of the result set.
-
virtual arrow::Result<std::unique_ptr<FlightDataStream>> DoGetCatalogs(const ServerCallContext &context)#
Get a FlightDataStream containing the list of catalogs.
- Parameters:
context – [in] Per-call context.
- Returns:
An interface for sending data back to the client.
-
virtual arrow::Result<std::unique_ptr<FlightInfo>> GetFlightInfoXdbcTypeInfo(const ServerCallContext &context, const GetXdbcTypeInfo &command, const FlightDescriptor &descriptor)#
Gets a FlightInfo 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:
-
virtual arrow::Result<std::unique_ptr<FlightDataStream>> DoGetXdbcTypeInfo(const ServerCallContext &context, const GetXdbcTypeInfo &command)#
Gets a FlightDataStream containing information about the data types supported.
- Parameters:
context – [in] Per-call context.
command – [in] The GetXdbcTypeInfo object which may contain filter for the date type to be search for.
- Returns:
-
virtual arrow::Result<std::unique_ptr<FlightInfo>> GetFlightInfoSqlInfo(const ServerCallContext &context, const GetSqlInfo &command, const FlightDescriptor &descriptor)#
Get a FlightInfo for retrieving other information (See SqlInfo).
- Parameters:
context – [in] Per-call context.
command – [in] The GetSqlInfo object containing the list of SqlInfo to be returned.
descriptor – [in] The descriptor identifying the data stream.
- Returns:
The FlightInfo describing where to access the dataset.
-
virtual arrow::Result<std::unique_ptr<FlightDataStream>> DoGetSqlInfo(const ServerCallContext &context, const GetSqlInfo &command)#
Get a FlightDataStream containing the list of SqlInfo results.
- Parameters:
context – [in] Per-call context.
command – [in] The GetSqlInfo object containing the list of SqlInfo to be returned.
- Returns:
The FlightDataStream containing the results.
-
virtual arrow::Result<std::unique_ptr<FlightInfo>> GetFlightInfoSchemas(const ServerCallContext &context, const GetDbSchemas &command, const FlightDescriptor &descriptor)#
Get a FlightInfo for listing schemas.
- Parameters:
context – [in] Per-call context.
command – [in] The GetDbSchemas object which may contain filters for catalog and schema name.
descriptor – [in] The descriptor identifying the data stream.
- Returns:
The FlightInfo describing where to access the dataset.
-
virtual arrow::Result<std::unique_ptr<FlightDataStream>> DoGetDbSchemas(const ServerCallContext &context, const GetDbSchemas &command)#
Get a FlightDataStream containing the list of schemas.
- Parameters:
context – [in] Per-call context.
command – [in] The GetDbSchemas object which may contain filters for catalog and schema name.
- Returns:
The FlightDataStream containing the results.
-
virtual arrow::Result<std::unique_ptr<FlightInfo>> GetFlightInfoTables(const ServerCallContext &context, const GetTables &command, const FlightDescriptor &descriptor)#
Get a FlightInfo for listing tables.
- Parameters:
context – [in] Per-call context.
command – [in] The GetTables object which may contain filters for catalog, schema and table names.
descriptor – [in] The descriptor identifying the data stream.
- Returns:
The FlightInfo describing where to access the dataset.
-
virtual arrow::Result<std::unique_ptr<FlightDataStream>> DoGetTables(const ServerCallContext &context, const GetTables &command)#
Get a FlightDataStream containing the list of tables.
- Parameters:
context – [in] Per-call context.
command – [in] The GetTables object which may contain filters for catalog, schema and table names.
- Returns:
The FlightDataStream containing the results.
-
virtual arrow::Result<std::unique_ptr<FlightInfo>> GetFlightInfoTableTypes(const ServerCallContext &context, const FlightDescriptor &descriptor)#
Get a FlightInfo to extract information about the table types.
- Parameters:
context – [in] Per-call context.
descriptor – [in] The descriptor identifying the data stream.
- Returns:
The FlightInfo describing where to access the dataset.
-
virtual arrow::Result<std::unique_ptr<FlightDataStream>> DoGetTableTypes(const ServerCallContext &context)#
Get a FlightDataStream containing the data related to the table types.
- Parameters:
context – [in] Per-call context.
- Returns:
The FlightDataStream containing the results.
-
virtual arrow::Result<std::unique_ptr<FlightInfo>> GetFlightInfoPrimaryKeys(const ServerCallContext &context, const GetPrimaryKeys &command, const FlightDescriptor &descriptor)#
Get a FlightInfo to extract information about primary and foreign keys.
- Parameters:
context – [in] Per-call context.
command – [in] The GetPrimaryKeys object with necessary information to execute the request.
descriptor – [in] The descriptor identifying the data stream.
- Returns:
The FlightInfo describing where to access the dataset.
-
virtual arrow::Result<std::unique_ptr<FlightDataStream>> DoGetPrimaryKeys(const ServerCallContext &context, const GetPrimaryKeys &command)#
Get a FlightDataStream containing the data related to the primary and foreign keys.
- Parameters:
context – [in] Per-call context.
command – [in] The GetPrimaryKeys object with necessary information to execute the request.
- Returns:
The FlightDataStream containing the results.
-
virtual arrow::Result<std::unique_ptr<FlightInfo>> GetFlightInfoExportedKeys(const ServerCallContext &context, const GetExportedKeys &command, const FlightDescriptor &descriptor)#
Get a FlightInfo to extract information about foreign and primary keys.
- Parameters:
context – [in] Per-call context.
command – [in] The GetExportedKeys object with necessary information to execute the request.
descriptor – [in] The descriptor identifying the data stream.
- Returns:
The FlightInfo describing where to access the dataset.
-
virtual arrow::Result<std::unique_ptr<FlightDataStream>> DoGetExportedKeys(const ServerCallContext &context, const GetExportedKeys &command)#
Get a FlightDataStream containing the data related to the foreign and primary keys.
- Parameters:
context – [in] Per-call context.
command – [in] The GetExportedKeys object with necessary information to execute the request.
- Returns:
The FlightDataStream containing the results.
-
virtual arrow::Result<std::unique_ptr<FlightInfo>> GetFlightInfoImportedKeys(const ServerCallContext &context, const GetImportedKeys &command, const FlightDescriptor &descriptor)#
Get a FlightInfo to extract information about foreign and primary keys.
- Parameters:
context – [in] Per-call context.
command – [in] The GetImportedKeys object with necessary information to execute the request.
descriptor – [in] The descriptor identifying the data stream.
- Returns:
The FlightInfo describing where to access the dataset.
-
virtual arrow::Result<std::unique_ptr<FlightDataStream>> DoGetImportedKeys(const ServerCallContext &context, const GetImportedKeys &command)#
Get a FlightDataStream containing the data related to the foreign and primary keys.
- Parameters:
context – [in] Per-call context.
command – [in] The GetImportedKeys object with necessary information to execute the request.
- Returns:
The FlightDataStream containing the results.
-
virtual arrow::Result<std::unique_ptr<FlightInfo>> GetFlightInfoCrossReference(const ServerCallContext &context, const GetCrossReference &command, const FlightDescriptor &descriptor)#
Get a FlightInfo to extract information about foreign and primary keys.
- Parameters:
context – [in] Per-call context.
command – [in] The GetCrossReference object with necessary information to execute the request.
descriptor – [in] The descriptor identifying the data stream.
- Returns:
The FlightInfo describing where to access the dataset.
-
virtual arrow::Result<std::unique_ptr<FlightDataStream>> DoGetCrossReference(const ServerCallContext &context, const GetCrossReference &command)#
Get a FlightDataStream containing the data related to the foreign and primary keys.
- Parameters:
context – [in] Per-call context.
command – [in] The GetCrossReference object with necessary information to execute the request.
- Returns:
The FlightDataStream containing the results.
-
virtual arrow::Result<int64_t> DoPutCommandStatementUpdate(const ServerCallContext &context, const StatementUpdate &command)#
Execute an update SQL statement.
- Parameters:
context – [in] The call context.
command – [in] The StatementUpdate object containing the SQL statement.
- Returns:
The changed record count.
-
virtual arrow::Result<int64_t> DoPutCommandSubstraitPlan(const ServerCallContext &context, const StatementSubstraitPlan &command)#
Execute an update Substrait plan.
- Parameters:
context – [in] The call context.
command – [in] The StatementSubstraitPlan object containing the plan.
- Returns:
The changed record count.
-
virtual arrow::Result<ActionCreatePreparedStatementResult> CreatePreparedStatement(const ServerCallContext &context, const ActionCreatePreparedStatementRequest &request)#
Create a prepared statement from a given SQL statement.
- Parameters:
context – [in] The call context.
request – [in] The ActionCreatePreparedStatementRequest object containing the SQL statement.
- Returns:
A ActionCreatePreparedStatementResult containing the dataset and parameter schemas and a handle for created statement.
-
virtual arrow::Result<ActionCreatePreparedStatementResult> CreatePreparedSubstraitPlan(const ServerCallContext &context, const ActionCreatePreparedSubstraitPlanRequest &request)#
Create a prepared statement from a Substrait plan.
- Parameters:
context – [in] The call context.
request – [in] The ActionCreatePreparedSubstraitPlanRequest object containing the Substrait plan.
- Returns:
A ActionCreatePreparedStatementResult containing the dataset and parameter schemas and a handle for created statement.
-
virtual Status ClosePreparedStatement(const ServerCallContext &context, const ActionClosePreparedStatementRequest &request)#
Close a prepared statement.
- Parameters:
context – [in] The call context.
request – [in] The ActionClosePreparedStatementRequest object containing the prepared statement handle.
-
virtual Status DoPutPreparedStatementQuery(const ServerCallContext &context, const PreparedStatementQuery &command, FlightMessageReader *reader, FlightMetadataWriter *writer)#
Bind parameters to given prepared statement.
- Parameters:
context – [in] The call context.
command – [in] The PreparedStatementQuery object containing the prepared statement handle.
reader – [in] A sequence of uploaded record batches.
writer – [in] Send metadata back to the client.
-
virtual arrow::Result<int64_t> DoPutPreparedStatementUpdate(const ServerCallContext &context, const PreparedStatementUpdate &command, FlightMessageReader *reader)#
Execute an update SQL prepared statement.
- Parameters:
context – [in] The call context.
command – [in] The PreparedStatementUpdate object containing the prepared statement handle.
reader – [in] a sequence of uploaded record batches.
- Returns:
The changed record count.
-
virtual arrow::Result<int64_t> DoPutCommandStatementIngest(const ServerCallContext &context, const StatementIngest &command, FlightMessageReader *reader)#
Execute a bulk ingestion.
- Parameters:
context – [in] The call context.
command – [in] The StatementIngest object containing the ingestion request.
reader – [in] a sequence of uploaded record batches.
- Returns:
The changed record count.
-
virtual arrow::Result<ActionBeginTransactionResult> BeginTransaction(const ServerCallContext &context, const ActionBeginTransactionRequest &request)#
Begin a new transaction.
- Parameters:
context – [in] The call context.
request – [in] Request parameters.
- Returns:
The transaction ID.
-
virtual arrow::Result<ActionBeginSavepointResult> BeginSavepoint(const ServerCallContext &context, const ActionBeginSavepointRequest &request)#
Create a new savepoint.
- Parameters:
context – [in] The call context.
request – [in] Request parameters.
- Returns:
The savepoint ID.
-
virtual Status EndSavepoint(const ServerCallContext &context, const ActionEndSavepointRequest &request)#
Release/rollback a savepoint.
- Parameters:
context – [in] The call context.
request – [in] The savepoint.
-
virtual Status EndTransaction(const ServerCallContext &context, const ActionEndTransactionRequest &request)#
Commit/rollback a transaction.
- Parameters:
context – [in] The call context.
request – [in] The transaction.
-
virtual arrow::Result<CancelFlightInfoResult> CancelFlightInfo(const ServerCallContext &context, const CancelFlightInfoRequest &request)#
Attempt to explicitly cancel a FlightInfo.
- Parameters:
context – [in] The call context.
request – [in] The CancelFlightInfoRequest.
- Returns:
The cancellation result.
-
virtual arrow::Result<SetSessionOptionsResult> SetSessionOptions(const ServerCallContext &context, const SetSessionOptionsRequest &request)#
Set server session option(s).
- Parameters:
context – [in] The call context.
request – [in] The session options to set.
-
virtual arrow::Result<GetSessionOptionsResult> GetSessionOptions(const ServerCallContext &context, const GetSessionOptionsRequest &request)#
Get server session option(s).
- Parameters:
context – [in] The call context.
request – [in] Request object.
-
virtual arrow::Result<CloseSessionResult> CloseSession(const ServerCallContext &context, const CloseSessionRequest &request)#
Close/invalidate the session.
- Parameters:
context – [in] The call context.
request – [in] Request object.
-
virtual arrow::Result<CancelResult> CancelQuery(const ServerCallContext &context, const ActionCancelQueryRequest &request)#
Attempt to explicitly cancel a query.
- Deprecated:
Deprecated in 13.0.0. You just need to implement CancelFlightInfo() 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.
-
virtual arrow::Result<FlightEndpoint> RenewFlightEndpoint(const ServerCallContext &context, const RenewFlightEndpointRequest &request)#
Attempt to explicitly renew a FlightEndpoint.
- Parameters:
context – [in] The call context.
request – [in] The RenewFlightEndpointRequest.
- Returns:
The renew result.
Utility methods
-
void RegisterSqlInfo(int32_t id, const SqlInfoResult &result)#
Register a new SqlInfo result, making it available when calling GetSqlInfo.
- Parameters:
id – [in] the SqlInfo identifier.
result – [in] the result.
-
virtual Status GetFlightInfo(const ServerCallContext &context, const FlightDescriptor &request, std::unique_ptr<FlightInfo> *info) final#
-
arrow::Result<std::string> arrow::flight::sql::CreateStatementQueryTicket(const std::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.
-
class SqlSchema#
Auxiliary class containing all Schemas used on Flight SQL.
Public Static Functions
-
static const std::shared_ptr<Schema> &GetCatalogsSchema()#
Get the Schema used on GetCatalogs response.
- Returns:
The default schema template.
-
static const std::shared_ptr<Schema> &GetDbSchemasSchema()#
Get the Schema used on GetDbSchemas response.
- Returns:
The default schema template.
-
static const std::shared_ptr<Schema> &GetTablesSchema()#
Get the Schema used on GetTables response when included schema flags is set to false.
- Returns:
The default schema template.
-
static const std::shared_ptr<Schema> &GetTablesSchemaWithIncludedSchema()#
Get the Schema used on GetTables response when included schema flags is set to true.
- Returns:
The default schema template.
-
static const std::shared_ptr<Schema> &GetTableTypesSchema()#
Get the Schema used on GetTableTypes response.
- Returns:
The default schema template.
-
static const std::shared_ptr<Schema> &GetPrimaryKeysSchema()#
Get the Schema used on GetPrimaryKeys response when included schema flags is set to true.
- Returns:
The default schema template.
-
static const std::shared_ptr<Schema> &GetExportedKeysSchema()#
Get the Schema used on GetImportedKeys response.
- Returns:
The default schema template.
-
static const std::shared_ptr<Schema> &GetImportedKeysSchema()#
Get the Schema used on GetImportedKeys response.
- Returns:
The default schema template.
-
static const std::shared_ptr<Schema> &GetCrossReferenceSchema()#
Get the Schema used on GetCrossReference response.
- Returns:
The default schema template.
-
static const std::shared_ptr<Schema> &GetXdbcTypeInfoSchema()#
Get the Schema used on GetXdbcTypeInfo response.
- Returns:
The default schema template.
-
static const std::shared_ptr<Schema> &GetSqlInfoSchema()#
Get the Schema used on GetSqlInfo response.
- Returns:
The default schema template.
-
static const std::shared_ptr<Schema> &GetCatalogsSchema()#
- group flight-sql-protocol-messages
Simple struct wrappers for various protocol messages, used to avoid exposing Protobuf types in the API.
-
struct StatementQuery#
- #include <arrow/flight/sql/server.h>
A SQL query.
-
struct StatementSubstraitPlan#
- #include <arrow/flight/sql/server.h>
A Substrait plan to execute.
Public Members
-
SubstraitPlan plan#
The Substrait plan.
-
std::string transaction_id#
The transaction ID, if specified (else a blank string).
-
SubstraitPlan plan#
-
struct StatementUpdate#
- #include <arrow/flight/sql/server.h>
A SQL update query.
-
struct StatementQueryTicket#
- #include <arrow/flight/sql/server.h>
A request to execute a query.
Public Members
-
std::string statement_handle#
The server-generated opaque identifier for the query.
-
std::string statement_handle#
-
struct PreparedStatementQuery#
- #include <arrow/flight/sql/server.h>
A prepared query statement.
Public Members
-
std::string prepared_statement_handle#
The server-generated opaque identifier for the statement.
-
std::string prepared_statement_handle#
-
struct PreparedStatementUpdate#
- #include <arrow/flight/sql/server.h>
A prepared update statement.
Public Members
-
std::string prepared_statement_handle#
The server-generated opaque identifier for the statement.
-
std::string prepared_statement_handle#
-
struct StatementIngest#
- #include <arrow/flight/sql/server.h>
A bulk ingestion request.
Public Members
-
TableDefinitionOptions table_definition_options#
The behavior for handling the table definition.
-
std::string table#
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.
-
bool temporary#
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.
-
TableDefinitionOptions table_definition_options#
-
struct GetSqlInfo#
- #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.
-
std::vector<int32_t> info#
-
struct GetDbSchemas#
- #include <arrow/flight/sql/server.h>
A request to list database schemas.
-
struct GetTables#
- #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.
-
bool include_schema#
Whether to include the Arrow schema in the response.
-
std::optional<std::string> catalog#
-
struct GetXdbcTypeInfo#
- #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.
-
std::optional<int> data_type#
-
struct GetPrimaryKeys#
- #include <arrow/flight/sql/server.h>
A request to list primary keys of a table.
-
struct GetExportedKeys#
- #include <arrow/flight/sql/server.h>
A request to list foreign key columns referencing primary key columns of a table.
-
struct GetImportedKeys#
- #include <arrow/flight/sql/server.h>
A request to list foreign keys of a table.
-
struct GetCrossReference#
- #include <arrow/flight/sql/server.h>
A request to list foreign key columns of a table that reference columns in a given parent table.
-
struct ActionBeginTransactionRequest#
- #include <arrow/flight/sql/server.h>
A request to start a new transaction.
-
struct ActionBeginSavepointRequest#
- #include <arrow/flight/sql/server.h>
A request to create a new savepoint.
-
struct ActionBeginSavepointResult#
- #include <arrow/flight/sql/server.h>
The result of starting a new savepoint.
-
struct ActionBeginTransactionResult#
- #include <arrow/flight/sql/server.h>
The result of starting a new transaction.
-
struct ActionEndSavepointRequest#
- #include <arrow/flight/sql/server.h>
A request to end a savepoint.
-
struct ActionEndTransactionRequest#
- #include <arrow/flight/sql/server.h>
A request to end a transaction.
-
struct ActionCancelQueryRequest#
- #include <arrow/flight/sql/server.h>
An explicit request to cancel a running query.
-
struct ActionCreatePreparedStatementRequest#
- #include <arrow/flight/sql/server.h>
A request to create a new prepared statement.
-
struct ActionCreatePreparedSubstraitPlanRequest#
- #include <arrow/flight/sql/server.h>
A request to create a new prepared statement with a Substrait plan.
Public Members
-
SubstraitPlan plan#
The serialized Substrait plan.
-
std::string transaction_id#
The transaction ID, if specified (else a blank string).
-
SubstraitPlan plan#
-
struct ActionClosePreparedStatementRequest#
- #include <arrow/flight/sql/server.h>
A request to close a prepared statement.
Public Members
-
std::string prepared_statement_handle#
The server-generated opaque identifier for the statement.
-
std::string prepared_statement_handle#
-
struct ActionCreatePreparedStatementResult#
- #include <arrow/flight/sql/server.h>
The result of creating a new prepared statement.
-
struct StatementQuery#