Arrow Flight SQL#
Arrow Flight SQL is a protocol for interacting with SQL databases using the Arrow in-memory format and the Flight RPC framework.
Generally, a database will implement the RPC methods according to the specification, but does not need to implement a client-side driver. A database client can use the provided Flight SQL client to interact with any database that supports the necessary endpoints. Flight SQL clients wrap the underlying Flight client to provide methods for the new RPC methods described here.
Warning
Flight SQL is experimental and changes to the protocol may still be made.
RPC Methods#
Flight SQL reuses the predefined RPC methods in Arrow Flight, and provides various commands that pair those methods with request/response messages defined via Protobuf (see below).
SQL Metadata#
Flight SQL provides a variety of commands to fetch catalog metadata about the database server.
All of these commands can be used with the GetFlightInfo and GetSchema
RPC methods. The Protobuf request message should be packed into a
google.protobuf.Any message, then serialized and packed as the cmd
field in a CMD-type FlightDescriptor.
If the command is used with GetFlightInfo, the server will return a FlightInfo response. The client should then use the Ticket(s) in the FlightInfo with the DoGet RPC method to fetch a Arrow data containing the results of the command. In other words, SQL metadata is returned as Arrow data, just like query results themselves.
The Arrow schema returned by GetSchema or DoGet for a particular command is fixed according to the specification.
CommandGetCatalogs
List the catalogs available in the database. The definition varies by vendor.
CommandGetCrossReference
List the foreign key columns in a given table that reference columns in a given parent table.
CommandGetDbSchemas
List the schemas (note: a grouping of tables, not an Arrow schema) available in the database. The definition varies by vendor.
CommandGetExportedKeys
List foreign key columns that reference the primary key columns of a given table.
CommandGetImportedKeys
List foreign keys of a given table.
CommandGetPrimaryKeys
List the primary keys of a given table.
CommandGetSqlInfo
Fetch metadata about the database server and its supported SQL features.
CommandGetTables
List tables in the database.
CommandGetTableTypes
List table types in the database. The list of types varies by vendor.
Query Execution#
Flight SQL also provides commands to execute SQL queries and manage prepared statements.
Many of these commands are also used with GetFlightInfo/GetSchema and work identically to the metadata methods above. Some of these commands can be used with the DoPut RPC method, but the command should still be encoded in the request FlightDescriptor in the same way.
Commands beginning with “Action” are instead used with the DoAction
RPC method, in which case the command should be packed into a
google.protobuf.Any message, then serialized and packed into the
body
of a Flight Action. Also, the action type
should be set
to the command name (i.e. for ActionClosePreparedStatementRequest
,
the type
should be ClosePreparedStatement
).
Commands that execute updates such as CommandStatementUpdate
and
CommandStatementIngest
return a Flight SQL DoPutUpdateResult
after consuming the entire FlightData stream. This message is encoded
in the app_metadata
field of the Flight RPC PutResult
returned.
ActionClosePreparedStatementRequest
Close a previously created prepared statement.
ActionCreatePreparedStatementRequest
Create a new prepared statement for a SQL query.
The response will contain an opaque handle used to identify the prepared statement. It may also contain two optional schemas: the Arrow schema of the result set, and the Arrow schema of the bind parameters (if any). Because the schema of the result set may depend on the bind parameters, the schemas may not necessarily be provided here as a result, or if provided, they may not be accurate. Clients should not assume the schema provided here will be the schema of any data actually returned by executing the prepared statement.
Some statements may have bind parameters without any specific type. (As a trivial example for SQL, consider
SELECT ?
.) It is not currently specified how this should be handled in the bind parameter schema above. We suggest either using a union type to enumerate the possible types, or using the NA (null) type as a wildcard/placeholder.CommandPreparedStatementQuery
Execute a previously created prepared statement and get the results.
When used with DoPut: binds parameter values to the prepared statement. The server may optionally provide an updated handle in the response. Updating the handle allows the client to supply all state required to execute the query in an ActionPreparedStatementExecute message. For example, stateless servers can encode the bound parameter values into the new handle, and the client will send that new handle with parameters back to the server.
Note that a handle returned from a DoPut call with CommandPreparedStatementQuery can itself be passed to a subsequent DoPut call with CommandPreparedStatementQuery to bind a new set of parameters. The subsequent call itself may return an updated handle which again should be used for subsequent requests.
The server is responsible for detecting the case where the client does not use the updated handle and should return an error.
When used with GetFlightInfo: execute the prepared statement. The prepared statement can be reused after fetching results.
When used with GetSchema: get the expected Arrow schema of the result set. If the client has bound parameter values with DoPut previously, the server should take those values into account.
CommandPreparedStatementUpdate
Execute a previously created prepared statement that does not return results.
When used with DoPut: execute the query and return the number of affected rows. The prepared statement can be reused afterwards.
CommandStatementQuery
Execute an ad-hoc SQL query.
When used with GetFlightInfo: execute the query (call DoGet to fetch results).
When used with GetSchema: return the schema of the query results.
CommandStatementUpdate
Execute an ad-hoc SQL query that does not return results.
When used with DoPut: execute the query and return the number of affected rows.
CommandStatementIngest
Execute a bulk ingestion.
When used with DoPut: load the stream of Arrow record batches into the specified target table and return the number of rows ingested via a DoPutUpdateResult message.
Flight Server Session Management#
Flight SQL provides commands to set and update server session variables
which affect the server behaviour in various ways. Common options may
include (depending on the server implementation) catalog
and
schema
, indicating the currently-selected catalog and schema for
queries to be run against.
Clients should prefer, where possible, setting options prior to issuing queries and other commands, as some server implementations may require these options be set exactly once and prior to any other activity which may trigger their implicit setting.
For compatibility with Database Connectivity drivers (JDBC, ODBC, and others), it is strongly recommended that server implementations accept string representations of all option values which may be provided to the driver as part of a server connection string and passed through to the server without further conversion. For ease of use it is also recommended to accept and convert other numeric types to the preferred type for an option value, however this is not required.
Sessions are persisted between the client and server using an implementation-defined mechanism, which is typically RFC 6265 cookies. Servers may also combine other connection state opaquely with the session token: Consider that the lifespan and semantics of a session should make sense for any additional uses, e.g. CloseSession would also invalidate any authentication context persisted via the session context. A session may be initiated upon a nonempty (or empty) SetSessionOptions call, or at any other time of the server’s choosing.
SetSessionOptions
Set server session option(s) by name/value.
GetSessionOptions
Get the current server session options, including those set by the client
and any defaulted or implicitly set by the server.
CloseSession
Close and invalidate the current session context.
Sequence Diagrams#
External Resources#
Protocol Buffer Definitions#
1/*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 * <p>
10 * http://www.apache.org/licenses/LICENSE-2.0
11 * <p>
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 */
18
19syntax = "proto3";
20import "google/protobuf/descriptor.proto";
21
22option java_package = "org.apache.arrow.flight.sql.impl";
23option go_package = "github.com/apache/arrow/go/arrow/flight/gen/flight";
24package arrow.flight.protocol.sql;
25
26/*
27 * Represents a metadata request. Used in the command member of FlightDescriptor
28 * for the following RPC calls:
29 * - GetSchema: return the Arrow schema of the query.
30 * - GetFlightInfo: execute the metadata request.
31 *
32 * The returned Arrow schema will be:
33 * <
34 * info_name: uint32 not null,
35 * value: dense_union<
36 * string_value: utf8,
37 * bool_value: bool,
38 * bigint_value: int64,
39 * int32_bitmask: int32,
40 * string_list: list<string_data: utf8>
41 * int32_to_int32_list_map: map<key: int32, value: list<$data$: int32>>
42 * >
43 * where there is one row per requested piece of metadata information.
44 */
45message CommandGetSqlInfo {
46 option (experimental) = true;
47
48 /*
49 * Values are modelled after ODBC's SQLGetInfo() function. This information is intended to provide
50 * Flight SQL clients with basic, SQL syntax and SQL functions related information.
51 * More information types can be added in future releases.
52 * E.g. more SQL syntax support types, scalar functions support, type conversion support etc.
53 *
54 * Note that the set of metadata may expand.
55 *
56 * Initially, Flight SQL will support the following information types:
57 * - Server Information - Range [0-500)
58 * - Syntax Information - Range [500-1000)
59 * Range [0-10,000) is reserved for defaults (see SqlInfo enum for default options).
60 * Custom options should start at 10,000.
61 *
62 * If omitted, then all metadata will be retrieved.
63 * Flight SQL Servers may choose to include additional metadata above and beyond the specified set, however they must
64 * at least return the specified set. IDs ranging from 0 to 10,000 (exclusive) are reserved for future use.
65 * If additional metadata is included, the metadata IDs should start from 10,000.
66 */
67 repeated uint32 info = 1;
68}
69
70// Options for CommandGetSqlInfo.
71enum SqlInfo {
72
73 // Server Information [0-500): Provides basic information about the Flight SQL Server.
74
75 // Retrieves a UTF-8 string with the name of the Flight SQL Server.
76 FLIGHT_SQL_SERVER_NAME = 0;
77
78 // Retrieves a UTF-8 string with the native version of the Flight SQL Server.
79 FLIGHT_SQL_SERVER_VERSION = 1;
80
81 // Retrieves a UTF-8 string with the Arrow format version of the Flight SQL Server.
82 FLIGHT_SQL_SERVER_ARROW_VERSION = 2;
83
84 /*
85 * Retrieves a boolean value indicating whether the Flight SQL Server is read only.
86 *
87 * Returns:
88 * - false: if read-write
89 * - true: if read only
90 */
91 FLIGHT_SQL_SERVER_READ_ONLY = 3;
92
93 /*
94 * Retrieves a boolean value indicating whether the Flight SQL Server supports executing
95 * SQL queries.
96 *
97 * Note that the absence of this info (as opposed to a false value) does not necessarily
98 * mean that SQL is not supported, as this property was not originally defined.
99 */
100 FLIGHT_SQL_SERVER_SQL = 4;
101
102 /*
103 * Retrieves a boolean value indicating whether the Flight SQL Server supports executing
104 * Substrait plans.
105 */
106 FLIGHT_SQL_SERVER_SUBSTRAIT = 5;
107
108 /*
109 * Retrieves a string value indicating the minimum supported Substrait version, or null
110 * if Substrait is not supported.
111 */
112 FLIGHT_SQL_SERVER_SUBSTRAIT_MIN_VERSION = 6;
113
114 /*
115 * Retrieves a string value indicating the maximum supported Substrait version, or null
116 * if Substrait is not supported.
117 */
118 FLIGHT_SQL_SERVER_SUBSTRAIT_MAX_VERSION = 7;
119
120 /*
121 * Retrieves an int32 indicating whether the Flight SQL Server supports the
122 * BeginTransaction/EndTransaction/BeginSavepoint/EndSavepoint actions.
123 *
124 * Even if this is not supported, the database may still support explicit "BEGIN
125 * TRANSACTION"/"COMMIT" SQL statements (see SQL_TRANSACTIONS_SUPPORTED); this property
126 * is only about whether the server implements the Flight SQL API endpoints.
127 *
128 * The possible values are listed in `SqlSupportedTransaction`.
129 */
130 FLIGHT_SQL_SERVER_TRANSACTION = 8;
131
132 /*
133 * Retrieves a boolean value indicating whether the Flight SQL Server supports explicit
134 * query cancellation (the CancelQuery action).
135 */
136 FLIGHT_SQL_SERVER_CANCEL = 9;
137
138 /*
139 * Retrieves a boolean value indicating whether the Flight SQL Server supports executing
140 * bulk ingestion.
141 */
142 FLIGHT_SQL_SERVER_BULK_INGESTION = 10;
143
144 /*
145 * Retrieves a boolean value indicating whether transactions are supported for bulk ingestion. If not, invoking
146 * the method commit in the context of a bulk ingestion is a noop, and the isolation level is
147 * `arrow.flight.protocol.sql.SqlTransactionIsolationLevel.TRANSACTION_NONE`.
148 *
149 * Returns:
150 * - false: if bulk ingestion transactions are unsupported;
151 * - true: if bulk ingestion transactions are supported.
152 */
153 FLIGHT_SQL_SERVER_INGEST_TRANSACTIONS_SUPPORTED = 11;
154
155 /*
156 * Retrieves an int32 indicating the timeout (in milliseconds) for prepared statement handles.
157 *
158 * If 0, there is no timeout. Servers should reset the timeout when the handle is used in a command.
159 */
160 FLIGHT_SQL_SERVER_STATEMENT_TIMEOUT = 100;
161
162 /*
163 * Retrieves an int32 indicating the timeout (in milliseconds) for transactions, since transactions are not tied to a connection.
164 *
165 * If 0, there is no timeout. Servers should reset the timeout when the handle is used in a command.
166 */
167 FLIGHT_SQL_SERVER_TRANSACTION_TIMEOUT = 101;
168
169 // SQL Syntax Information [500-1000): provides information about SQL syntax supported by the Flight SQL Server.
170
171 /*
172 * Retrieves a boolean value indicating whether the Flight SQL Server supports CREATE and DROP of catalogs.
173 *
174 * Returns:
175 * - false: if it doesn't support CREATE and DROP of catalogs.
176 * - true: if it supports CREATE and DROP of catalogs.
177 */
178 SQL_DDL_CATALOG = 500;
179
180 /*
181 * Retrieves a boolean value indicating whether the Flight SQL Server supports CREATE and DROP of schemas.
182 *
183 * Returns:
184 * - false: if it doesn't support CREATE and DROP of schemas.
185 * - true: if it supports CREATE and DROP of schemas.
186 */
187 SQL_DDL_SCHEMA = 501;
188
189 /*
190 * Indicates whether the Flight SQL Server supports CREATE and DROP of tables.
191 *
192 * Returns:
193 * - false: if it doesn't support CREATE and DROP of tables.
194 * - true: if it supports CREATE and DROP of tables.
195 */
196 SQL_DDL_TABLE = 502;
197
198 /*
199 * Retrieves a int32 ordinal representing the case sensitivity of catalog, table, schema and table names.
200 *
201 * The possible values are listed in `arrow.flight.protocol.sql.SqlSupportedCaseSensitivity`.
202 */
203 SQL_IDENTIFIER_CASE = 503;
204
205 // Retrieves a UTF-8 string with the supported character(s) used to surround a delimited identifier.
206 SQL_IDENTIFIER_QUOTE_CHAR = 504;
207
208 /*
209 * Retrieves a int32 describing the case sensitivity of quoted identifiers.
210 *
211 * The possible values are listed in `arrow.flight.protocol.sql.SqlSupportedCaseSensitivity`.
212 */
213 SQL_QUOTED_IDENTIFIER_CASE = 505;
214
215 /*
216 * Retrieves a boolean value indicating whether all tables are selectable.
217 *
218 * Returns:
219 * - false: if not all tables are selectable or if none are;
220 * - true: if all tables are selectable.
221 */
222 SQL_ALL_TABLES_ARE_SELECTABLE = 506;
223
224 /*
225 * Retrieves the null ordering.
226 *
227 * Returns a int32 ordinal for the null ordering being used, as described in
228 * `arrow.flight.protocol.sql.SqlNullOrdering`.
229 */
230 SQL_NULL_ORDERING = 507;
231
232 // Retrieves a UTF-8 string list with values of the supported keywords.
233 SQL_KEYWORDS = 508;
234
235 // Retrieves a UTF-8 string list with values of the supported numeric functions.
236 SQL_NUMERIC_FUNCTIONS = 509;
237
238 // Retrieves a UTF-8 string list with values of the supported string functions.
239 SQL_STRING_FUNCTIONS = 510;
240
241 // Retrieves a UTF-8 string list with values of the supported system functions.
242 SQL_SYSTEM_FUNCTIONS = 511;
243
244 // Retrieves a UTF-8 string list with values of the supported datetime functions.
245 SQL_DATETIME_FUNCTIONS = 512;
246
247 /*
248 * Retrieves the UTF-8 string that can be used to escape wildcard characters.
249 * This is the string that can be used to escape '_' or '%' in the catalog search parameters that are a pattern
250 * (and therefore use one of the wildcard characters).
251 * The '_' character represents any single character; the '%' character represents any sequence of zero or more
252 * characters.
253 */
254 SQL_SEARCH_STRING_ESCAPE = 513;
255
256 /*
257 * Retrieves a UTF-8 string with all the "extra" characters that can be used in unquoted identifier names
258 * (those beyond a-z, A-Z, 0-9 and _).
259 */
260 SQL_EXTRA_NAME_CHARACTERS = 514;
261
262 /*
263 * Retrieves a boolean value indicating whether column aliasing is supported.
264 * If so, the SQL AS clause can be used to provide names for computed columns or to provide alias names for columns
265 * as required.
266 *
267 * Returns:
268 * - false: if column aliasing is unsupported;
269 * - true: if column aliasing is supported.
270 */
271 SQL_SUPPORTS_COLUMN_ALIASING = 515;
272
273 /*
274 * Retrieves a boolean value indicating whether concatenations between null and non-null values being
275 * null are supported.
276 *
277 * - Returns:
278 * - false: if concatenations between null and non-null values being null are unsupported;
279 * - true: if concatenations between null and non-null values being null are supported.
280 */
281 SQL_NULL_PLUS_NULL_IS_NULL = 516;
282
283 /*
284 * Retrieves a map where the key is the type to convert from and the value is a list with the types to convert to,
285 * indicating the supported conversions. Each key and each item on the list value is a value to a predefined type on
286 * SqlSupportsConvert enum.
287 * The returned map will be: map<int32, list<int32>>
288 */
289 SQL_SUPPORTS_CONVERT = 517;
290
291 /*
292 * Retrieves a boolean value indicating whether, when table correlation names are supported,
293 * they are restricted to being different from the names of the tables.
294 *
295 * Returns:
296 * - false: if table correlation names are unsupported;
297 * - true: if table correlation names are supported.
298 */
299 SQL_SUPPORTS_TABLE_CORRELATION_NAMES = 518;
300
301 /*
302 * Retrieves a boolean value indicating whether, when table correlation names are supported,
303 * they are restricted to being different from the names of the tables.
304 *
305 * Returns:
306 * - false: if different table correlation names are unsupported;
307 * - true: if different table correlation names are supported
308 */
309 SQL_SUPPORTS_DIFFERENT_TABLE_CORRELATION_NAMES = 519;
310
311 /*
312 * Retrieves a boolean value indicating whether expressions in ORDER BY lists are supported.
313 *
314 * Returns:
315 * - false: if expressions in ORDER BY are unsupported;
316 * - true: if expressions in ORDER BY are supported;
317 */
318 SQL_SUPPORTS_EXPRESSIONS_IN_ORDER_BY = 520;
319
320 /*
321 * Retrieves a boolean value indicating whether using a column that is not in the SELECT statement in a GROUP BY
322 * clause is supported.
323 *
324 * Returns:
325 * - false: if using a column that is not in the SELECT statement in a GROUP BY clause is unsupported;
326 * - true: if using a column that is not in the SELECT statement in a GROUP BY clause is supported.
327 */
328 SQL_SUPPORTS_ORDER_BY_UNRELATED = 521;
329
330 /*
331 * Retrieves the supported GROUP BY commands;
332 *
333 * Returns an int32 bitmask value representing the supported commands.
334 * The returned bitmask should be parsed in order to retrieve the supported commands.
335 *
336 * For instance:
337 * - return 0 (\b0) => [] (GROUP BY is unsupported);
338 * - return 1 (\b1) => [SQL_GROUP_BY_UNRELATED];
339 * - return 2 (\b10) => [SQL_GROUP_BY_BEYOND_SELECT];
340 * - return 3 (\b11) => [SQL_GROUP_BY_UNRELATED, SQL_GROUP_BY_BEYOND_SELECT].
341 * Valid GROUP BY types are described under `arrow.flight.protocol.sql.SqlSupportedGroupBy`.
342 */
343 SQL_SUPPORTED_GROUP_BY = 522;
344
345 /*
346 * Retrieves a boolean value indicating whether specifying a LIKE escape clause is supported.
347 *
348 * Returns:
349 * - false: if specifying a LIKE escape clause is unsupported;
350 * - true: if specifying a LIKE escape clause is supported.
351 */
352 SQL_SUPPORTS_LIKE_ESCAPE_CLAUSE = 523;
353
354 /*
355 * Retrieves a boolean value indicating whether columns may be defined as non-nullable.
356 *
357 * Returns:
358 * - false: if columns cannot be defined as non-nullable;
359 * - true: if columns may be defined as non-nullable.
360 */
361 SQL_SUPPORTS_NON_NULLABLE_COLUMNS = 524;
362
363 /*
364 * Retrieves the supported SQL grammar level as per the ODBC specification.
365 *
366 * Returns an int32 bitmask value representing the supported SQL grammar level.
367 * The returned bitmask should be parsed in order to retrieve the supported grammar levels.
368 *
369 * For instance:
370 * - return 0 (\b0) => [] (SQL grammar is unsupported);
371 * - return 1 (\b1) => [SQL_MINIMUM_GRAMMAR];
372 * - return 2 (\b10) => [SQL_CORE_GRAMMAR];
373 * - return 3 (\b11) => [SQL_MINIMUM_GRAMMAR, SQL_CORE_GRAMMAR];
374 * - return 4 (\b100) => [SQL_EXTENDED_GRAMMAR];
375 * - return 5 (\b101) => [SQL_MINIMUM_GRAMMAR, SQL_EXTENDED_GRAMMAR];
376 * - return 6 (\b110) => [SQL_CORE_GRAMMAR, SQL_EXTENDED_GRAMMAR];
377 * - return 7 (\b111) => [SQL_MINIMUM_GRAMMAR, SQL_CORE_GRAMMAR, SQL_EXTENDED_GRAMMAR].
378 * Valid SQL grammar levels are described under `arrow.flight.protocol.sql.SupportedSqlGrammar`.
379 */
380 SQL_SUPPORTED_GRAMMAR = 525;
381
382 /*
383 * Retrieves the supported ANSI92 SQL grammar level.
384 *
385 * Returns an int32 bitmask value representing the supported ANSI92 SQL grammar level.
386 * The returned bitmask should be parsed in order to retrieve the supported commands.
387 *
388 * For instance:
389 * - return 0 (\b0) => [] (ANSI92 SQL grammar is unsupported);
390 * - return 1 (\b1) => [ANSI92_ENTRY_SQL];
391 * - return 2 (\b10) => [ANSI92_INTERMEDIATE_SQL];
392 * - return 3 (\b11) => [ANSI92_ENTRY_SQL, ANSI92_INTERMEDIATE_SQL];
393 * - return 4 (\b100) => [ANSI92_FULL_SQL];
394 * - return 5 (\b101) => [ANSI92_ENTRY_SQL, ANSI92_FULL_SQL];
395 * - return 6 (\b110) => [ANSI92_INTERMEDIATE_SQL, ANSI92_FULL_SQL];
396 * - return 7 (\b111) => [ANSI92_ENTRY_SQL, ANSI92_INTERMEDIATE_SQL, ANSI92_FULL_SQL].
397 * Valid ANSI92 SQL grammar levels are described under `arrow.flight.protocol.sql.SupportedAnsi92SqlGrammarLevel`.
398 */
399 SQL_ANSI92_SUPPORTED_LEVEL = 526;
400
401 /*
402 * Retrieves a boolean value indicating whether the SQL Integrity Enhancement Facility is supported.
403 *
404 * Returns:
405 * - false: if the SQL Integrity Enhancement Facility is supported;
406 * - true: if the SQL Integrity Enhancement Facility is supported.
407 */
408 SQL_SUPPORTS_INTEGRITY_ENHANCEMENT_FACILITY = 527;
409
410 /*
411 * Retrieves the support level for SQL OUTER JOINs.
412 *
413 * Returns a int32 ordinal for the SQL ordering being used, as described in
414 * `arrow.flight.protocol.sql.SqlOuterJoinsSupportLevel`.
415 */
416 SQL_OUTER_JOINS_SUPPORT_LEVEL = 528;
417
418 // Retrieves a UTF-8 string with the preferred term for "schema".
419 SQL_SCHEMA_TERM = 529;
420
421 // Retrieves a UTF-8 string with the preferred term for "procedure".
422 SQL_PROCEDURE_TERM = 530;
423
424 /*
425 * Retrieves a UTF-8 string with the preferred term for "catalog".
426 * If a empty string is returned its assumed that the server does NOT supports catalogs.
427 */
428 SQL_CATALOG_TERM = 531;
429
430 /*
431 * Retrieves a boolean value indicating whether a catalog appears at the start of a fully qualified table name.
432 *
433 * - false: if a catalog does not appear at the start of a fully qualified table name;
434 * - true: if a catalog appears at the start of a fully qualified table name.
435 */
436 SQL_CATALOG_AT_START = 532;
437
438 /*
439 * Retrieves the supported actions for a SQL schema.
440 *
441 * Returns an int32 bitmask value representing the supported actions for a SQL schema.
442 * The returned bitmask should be parsed in order to retrieve the supported actions for a SQL schema.
443 *
444 * For instance:
445 * - return 0 (\b0) => [] (no supported actions for SQL schema);
446 * - return 1 (\b1) => [SQL_ELEMENT_IN_PROCEDURE_CALLS];
447 * - return 2 (\b10) => [SQL_ELEMENT_IN_INDEX_DEFINITIONS];
448 * - return 3 (\b11) => [SQL_ELEMENT_IN_PROCEDURE_CALLS, SQL_ELEMENT_IN_INDEX_DEFINITIONS];
449 * - return 4 (\b100) => [SQL_ELEMENT_IN_PRIVILEGE_DEFINITIONS];
450 * - return 5 (\b101) => [SQL_ELEMENT_IN_PROCEDURE_CALLS, SQL_ELEMENT_IN_PRIVILEGE_DEFINITIONS];
451 * - return 6 (\b110) => [SQL_ELEMENT_IN_INDEX_DEFINITIONS, SQL_ELEMENT_IN_PRIVILEGE_DEFINITIONS];
452 * - return 7 (\b111) => [SQL_ELEMENT_IN_PROCEDURE_CALLS, SQL_ELEMENT_IN_INDEX_DEFINITIONS, SQL_ELEMENT_IN_PRIVILEGE_DEFINITIONS].
453 * Valid actions for a SQL schema described under `arrow.flight.protocol.sql.SqlSupportedElementActions`.
454 */
455 SQL_SCHEMAS_SUPPORTED_ACTIONS = 533;
456
457 /*
458 * Retrieves the supported actions for a SQL schema.
459 *
460 * Returns an int32 bitmask value representing the supported actions for a SQL catalog.
461 * The returned bitmask should be parsed in order to retrieve the supported actions for a SQL catalog.
462 *
463 * For instance:
464 * - return 0 (\b0) => [] (no supported actions for SQL catalog);
465 * - return 1 (\b1) => [SQL_ELEMENT_IN_PROCEDURE_CALLS];
466 * - return 2 (\b10) => [SQL_ELEMENT_IN_INDEX_DEFINITIONS];
467 * - return 3 (\b11) => [SQL_ELEMENT_IN_PROCEDURE_CALLS, SQL_ELEMENT_IN_INDEX_DEFINITIONS];
468 * - return 4 (\b100) => [SQL_ELEMENT_IN_PRIVILEGE_DEFINITIONS];
469 * - return 5 (\b101) => [SQL_ELEMENT_IN_PROCEDURE_CALLS, SQL_ELEMENT_IN_PRIVILEGE_DEFINITIONS];
470 * - return 6 (\b110) => [SQL_ELEMENT_IN_INDEX_DEFINITIONS, SQL_ELEMENT_IN_PRIVILEGE_DEFINITIONS];
471 * - return 7 (\b111) => [SQL_ELEMENT_IN_PROCEDURE_CALLS, SQL_ELEMENT_IN_INDEX_DEFINITIONS, SQL_ELEMENT_IN_PRIVILEGE_DEFINITIONS].
472 * Valid actions for a SQL catalog are described under `arrow.flight.protocol.sql.SqlSupportedElementActions`.
473 */
474 SQL_CATALOGS_SUPPORTED_ACTIONS = 534;
475
476 /*
477 * Retrieves the supported SQL positioned commands.
478 *
479 * Returns an int32 bitmask value representing the supported SQL positioned commands.
480 * The returned bitmask should be parsed in order to retrieve the supported SQL positioned commands.
481 *
482 * For instance:
483 * - return 0 (\b0) => [] (no supported SQL positioned commands);
484 * - return 1 (\b1) => [SQL_POSITIONED_DELETE];
485 * - return 2 (\b10) => [SQL_POSITIONED_UPDATE];
486 * - return 3 (\b11) => [SQL_POSITIONED_DELETE, SQL_POSITIONED_UPDATE].
487 * Valid SQL positioned commands are described under `arrow.flight.protocol.sql.SqlSupportedPositionedCommands`.
488 */
489 SQL_SUPPORTED_POSITIONED_COMMANDS = 535;
490
491 /*
492 * Retrieves a boolean value indicating whether SELECT FOR UPDATE statements are supported.
493 *
494 * Returns:
495 * - false: if SELECT FOR UPDATE statements are unsupported;
496 * - true: if SELECT FOR UPDATE statements are supported.
497 */
498 SQL_SELECT_FOR_UPDATE_SUPPORTED = 536;
499
500 /*
501 * Retrieves a boolean value indicating whether stored procedure calls that use the stored procedure escape syntax
502 * are supported.
503 *
504 * Returns:
505 * - false: if stored procedure calls that use the stored procedure escape syntax are unsupported;
506 * - true: if stored procedure calls that use the stored procedure escape syntax are supported.
507 */
508 SQL_STORED_PROCEDURES_SUPPORTED = 537;
509
510 /*
511 * Retrieves the supported SQL subqueries.
512 *
513 * Returns an int32 bitmask value representing the supported SQL subqueries.
514 * The returned bitmask should be parsed in order to retrieve the supported SQL subqueries.
515 *
516 * For instance:
517 * - return 0 (\b0) => [] (no supported SQL subqueries);
518 * - return 1 (\b1) => [SQL_SUBQUERIES_IN_COMPARISONS];
519 * - return 2 (\b10) => [SQL_SUBQUERIES_IN_EXISTS];
520 * - return 3 (\b11) => [SQL_SUBQUERIES_IN_COMPARISONS, SQL_SUBQUERIES_IN_EXISTS];
521 * - return 4 (\b100) => [SQL_SUBQUERIES_IN_INS];
522 * - return 5 (\b101) => [SQL_SUBQUERIES_IN_COMPARISONS, SQL_SUBQUERIES_IN_INS];
523 * - return 6 (\b110) => [SQL_SUBQUERIES_IN_INS, SQL_SUBQUERIES_IN_EXISTS];
524 * - return 7 (\b111) => [SQL_SUBQUERIES_IN_COMPARISONS, SQL_SUBQUERIES_IN_EXISTS, SQL_SUBQUERIES_IN_INS];
525 * - return 8 (\b1000) => [SQL_SUBQUERIES_IN_QUANTIFIEDS];
526 * - return 9 (\b1001) => [SQL_SUBQUERIES_IN_COMPARISONS, SQL_SUBQUERIES_IN_QUANTIFIEDS];
527 * - return 10 (\b1010) => [SQL_SUBQUERIES_IN_EXISTS, SQL_SUBQUERIES_IN_QUANTIFIEDS];
528 * - return 11 (\b1011) => [SQL_SUBQUERIES_IN_COMPARISONS, SQL_SUBQUERIES_IN_EXISTS, SQL_SUBQUERIES_IN_QUANTIFIEDS];
529 * - return 12 (\b1100) => [SQL_SUBQUERIES_IN_INS, SQL_SUBQUERIES_IN_QUANTIFIEDS];
530 * - return 13 (\b1101) => [SQL_SUBQUERIES_IN_COMPARISONS, SQL_SUBQUERIES_IN_INS, SQL_SUBQUERIES_IN_QUANTIFIEDS];
531 * - return 14 (\b1110) => [SQL_SUBQUERIES_IN_EXISTS, SQL_SUBQUERIES_IN_INS, SQL_SUBQUERIES_IN_QUANTIFIEDS];
532 * - return 15 (\b1111) => [SQL_SUBQUERIES_IN_COMPARISONS, SQL_SUBQUERIES_IN_EXISTS, SQL_SUBQUERIES_IN_INS, SQL_SUBQUERIES_IN_QUANTIFIEDS];
533 * - ...
534 * Valid SQL subqueries are described under `arrow.flight.protocol.sql.SqlSupportedSubqueries`.
535 */
536 SQL_SUPPORTED_SUBQUERIES = 538;
537
538 /*
539 * Retrieves a boolean value indicating whether correlated subqueries are supported.
540 *
541 * Returns:
542 * - false: if correlated subqueries are unsupported;
543 * - true: if correlated subqueries are supported.
544 */
545 SQL_CORRELATED_SUBQUERIES_SUPPORTED = 539;
546
547 /*
548 * Retrieves the supported SQL UNIONs.
549 *
550 * Returns an int32 bitmask value representing the supported SQL UNIONs.
551 * The returned bitmask should be parsed in order to retrieve the supported SQL UNIONs.
552 *
553 * For instance:
554 * - return 0 (\b0) => [] (no supported SQL positioned commands);
555 * - return 1 (\b1) => [SQL_UNION];
556 * - return 2 (\b10) => [SQL_UNION_ALL];
557 * - return 3 (\b11) => [SQL_UNION, SQL_UNION_ALL].
558 * Valid SQL positioned commands are described under `arrow.flight.protocol.sql.SqlSupportedUnions`.
559 */
560 SQL_SUPPORTED_UNIONS = 540;
561
562 // Retrieves a int64 value representing the maximum number of hex characters allowed in an inline binary literal.
563 SQL_MAX_BINARY_LITERAL_LENGTH = 541;
564
565 // Retrieves a int64 value representing the maximum number of characters allowed for a character literal.
566 SQL_MAX_CHAR_LITERAL_LENGTH = 542;
567
568 // Retrieves a int64 value representing the maximum number of characters allowed for a column name.
569 SQL_MAX_COLUMN_NAME_LENGTH = 543;
570
571 // Retrieves a int64 value representing the maximum number of columns allowed in a GROUP BY clause.
572 SQL_MAX_COLUMNS_IN_GROUP_BY = 544;
573
574 // Retrieves a int64 value representing the maximum number of columns allowed in an index.
575 SQL_MAX_COLUMNS_IN_INDEX = 545;
576
577 // Retrieves a int64 value representing the maximum number of columns allowed in an ORDER BY clause.
578 SQL_MAX_COLUMNS_IN_ORDER_BY = 546;
579
580 // Retrieves a int64 value representing the maximum number of columns allowed in a SELECT list.
581 SQL_MAX_COLUMNS_IN_SELECT = 547;
582
583 // Retrieves a int64 value representing the maximum number of columns allowed in a table.
584 SQL_MAX_COLUMNS_IN_TABLE = 548;
585
586 // Retrieves a int64 value representing the maximum number of concurrent connections possible.
587 SQL_MAX_CONNECTIONS = 549;
588
589 // Retrieves a int64 value the maximum number of characters allowed in a cursor name.
590 SQL_MAX_CURSOR_NAME_LENGTH = 550;
591
592 /*
593 * Retrieves a int64 value representing the maximum number of bytes allowed for an index,
594 * including all of the parts of the index.
595 */
596 SQL_MAX_INDEX_LENGTH = 551;
597
598 // Retrieves a int64 value representing the maximum number of characters allowed in a schema name.
599 SQL_DB_SCHEMA_NAME_LENGTH = 552;
600
601 // Retrieves a int64 value representing the maximum number of characters allowed in a procedure name.
602 SQL_MAX_PROCEDURE_NAME_LENGTH = 553;
603
604 // Retrieves a int64 value representing the maximum number of characters allowed in a catalog name.
605 SQL_MAX_CATALOG_NAME_LENGTH = 554;
606
607 // Retrieves a int64 value representing the maximum number of bytes allowed in a single row.
608 SQL_MAX_ROW_SIZE = 555;
609
610 /*
611 * Retrieves a boolean indicating whether the return value for the JDBC method getMaxRowSize includes the SQL
612 * data types LONGVARCHAR and LONGVARBINARY.
613 *
614 * Returns:
615 * - false: if return value for the JDBC method getMaxRowSize does
616 * not include the SQL data types LONGVARCHAR and LONGVARBINARY;
617 * - true: if return value for the JDBC method getMaxRowSize includes
618 * the SQL data types LONGVARCHAR and LONGVARBINARY.
619 */
620 SQL_MAX_ROW_SIZE_INCLUDES_BLOBS = 556;
621
622 /*
623 * Retrieves a int64 value representing the maximum number of characters allowed for an SQL statement;
624 * a result of 0 (zero) means that there is no limit or the limit is not known.
625 */
626 SQL_MAX_STATEMENT_LENGTH = 557;
627
628 // Retrieves a int64 value representing the maximum number of active statements that can be open at the same time.
629 SQL_MAX_STATEMENTS = 558;
630
631 // Retrieves a int64 value representing the maximum number of characters allowed in a table name.
632 SQL_MAX_TABLE_NAME_LENGTH = 559;
633
634 // Retrieves a int64 value representing the maximum number of tables allowed in a SELECT statement.
635 SQL_MAX_TABLES_IN_SELECT = 560;
636
637 // Retrieves a int64 value representing the maximum number of characters allowed in a user name.
638 SQL_MAX_USERNAME_LENGTH = 561;
639
640 /*
641 * Retrieves this database's default transaction isolation level as described in
642 * `arrow.flight.protocol.sql.SqlTransactionIsolationLevel`.
643 *
644 * Returns a int32 ordinal for the SQL transaction isolation level.
645 */
646 SQL_DEFAULT_TRANSACTION_ISOLATION = 562;
647
648 /*
649 * Retrieves a boolean value indicating whether transactions are supported. If not, invoking the method commit is a
650 * noop, and the isolation level is `arrow.flight.protocol.sql.SqlTransactionIsolationLevel.TRANSACTION_NONE`.
651 *
652 * Returns:
653 * - false: if transactions are unsupported;
654 * - true: if transactions are supported.
655 */
656 SQL_TRANSACTIONS_SUPPORTED = 563;
657
658 /*
659 * Retrieves the supported transactions isolation levels.
660 *
661 * Returns an int32 bitmask value representing the supported transactions isolation levels.
662 * The returned bitmask should be parsed in order to retrieve the supported transactions isolation levels.
663 *
664 * For instance:
665 * - return 0 (\b0) => [] (no supported SQL transactions isolation levels);
666 * - return 1 (\b1) => [SQL_TRANSACTION_NONE];
667 * - return 2 (\b10) => [SQL_TRANSACTION_READ_UNCOMMITTED];
668 * - return 3 (\b11) => [SQL_TRANSACTION_NONE, SQL_TRANSACTION_READ_UNCOMMITTED];
669 * - return 4 (\b100) => [SQL_TRANSACTION_REPEATABLE_READ];
670 * - return 5 (\b101) => [SQL_TRANSACTION_NONE, SQL_TRANSACTION_REPEATABLE_READ];
671 * - return 6 (\b110) => [SQL_TRANSACTION_READ_UNCOMMITTED, SQL_TRANSACTION_REPEATABLE_READ];
672 * - return 7 (\b111) => [SQL_TRANSACTION_NONE, SQL_TRANSACTION_READ_UNCOMMITTED, SQL_TRANSACTION_REPEATABLE_READ];
673 * - return 8 (\b1000) => [SQL_TRANSACTION_REPEATABLE_READ];
674 * - return 9 (\b1001) => [SQL_TRANSACTION_NONE, SQL_TRANSACTION_REPEATABLE_READ];
675 * - return 10 (\b1010) => [SQL_TRANSACTION_READ_UNCOMMITTED, SQL_TRANSACTION_REPEATABLE_READ];
676 * - return 11 (\b1011) => [SQL_TRANSACTION_NONE, SQL_TRANSACTION_READ_UNCOMMITTED, SQL_TRANSACTION_REPEATABLE_READ];
677 * - return 12 (\b1100) => [SQL_TRANSACTION_REPEATABLE_READ, SQL_TRANSACTION_REPEATABLE_READ];
678 * - return 13 (\b1101) => [SQL_TRANSACTION_NONE, SQL_TRANSACTION_REPEATABLE_READ, SQL_TRANSACTION_REPEATABLE_READ];
679 * - return 14 (\b1110) => [SQL_TRANSACTION_READ_UNCOMMITTED, SQL_TRANSACTION_REPEATABLE_READ, SQL_TRANSACTION_REPEATABLE_READ];
680 * - return 15 (\b1111) => [SQL_TRANSACTION_NONE, SQL_TRANSACTION_READ_UNCOMMITTED, SQL_TRANSACTION_REPEATABLE_READ, SQL_TRANSACTION_REPEATABLE_READ];
681 * - return 16 (\b10000) => [SQL_TRANSACTION_SERIALIZABLE];
682 * - ...
683 * Valid SQL positioned commands are described under `arrow.flight.protocol.sql.SqlTransactionIsolationLevel`.
684 */
685 SQL_SUPPORTED_TRANSACTIONS_ISOLATION_LEVELS = 564;
686
687 /*
688 * Retrieves a boolean value indicating whether a data definition statement within a transaction forces
689 * the transaction to commit.
690 *
691 * Returns:
692 * - false: if a data definition statement within a transaction does not force the transaction to commit;
693 * - true: if a data definition statement within a transaction forces the transaction to commit.
694 */
695 SQL_DATA_DEFINITION_CAUSES_TRANSACTION_COMMIT = 565;
696
697 /*
698 * Retrieves a boolean value indicating whether a data definition statement within a transaction is ignored.
699 *
700 * Returns:
701 * - false: if a data definition statement within a transaction is taken into account;
702 * - true: a data definition statement within a transaction is ignored.
703 */
704 SQL_DATA_DEFINITIONS_IN_TRANSACTIONS_IGNORED = 566;
705
706 /*
707 * Retrieves an int32 bitmask value representing the supported result set types.
708 * The returned bitmask should be parsed in order to retrieve the supported result set types.
709 *
710 * For instance:
711 * - return 0 (\b0) => [] (no supported result set types);
712 * - return 1 (\b1) => [SQL_RESULT_SET_TYPE_UNSPECIFIED];
713 * - return 2 (\b10) => [SQL_RESULT_SET_TYPE_FORWARD_ONLY];
714 * - return 3 (\b11) => [SQL_RESULT_SET_TYPE_UNSPECIFIED, SQL_RESULT_SET_TYPE_FORWARD_ONLY];
715 * - return 4 (\b100) => [SQL_RESULT_SET_TYPE_SCROLL_INSENSITIVE];
716 * - return 5 (\b101) => [SQL_RESULT_SET_TYPE_UNSPECIFIED, SQL_RESULT_SET_TYPE_SCROLL_INSENSITIVE];
717 * - return 6 (\b110) => [SQL_RESULT_SET_TYPE_FORWARD_ONLY, SQL_RESULT_SET_TYPE_SCROLL_INSENSITIVE];
718 * - return 7 (\b111) => [SQL_RESULT_SET_TYPE_UNSPECIFIED, SQL_RESULT_SET_TYPE_FORWARD_ONLY, SQL_RESULT_SET_TYPE_SCROLL_INSENSITIVE];
719 * - return 8 (\b1000) => [SQL_RESULT_SET_TYPE_SCROLL_SENSITIVE];
720 * - ...
721 * Valid result set types are described under `arrow.flight.protocol.sql.SqlSupportedResultSetType`.
722 */
723 SQL_SUPPORTED_RESULT_SET_TYPES = 567;
724
725 /*
726 * Returns an int32 bitmask value concurrency types supported for
727 * `arrow.flight.protocol.sql.SqlSupportedResultSetType.SQL_RESULT_SET_TYPE_UNSPECIFIED`.
728 *
729 * For instance:
730 * - return 0 (\b0) => [] (no supported concurrency types for this result set type)
731 * - return 1 (\b1) => [SQL_RESULT_SET_CONCURRENCY_UNSPECIFIED]
732 * - return 2 (\b10) => [SQL_RESULT_SET_CONCURRENCY_READ_ONLY]
733 * - return 3 (\b11) => [SQL_RESULT_SET_CONCURRENCY_UNSPECIFIED, SQL_RESULT_SET_CONCURRENCY_READ_ONLY]
734 * - return 4 (\b100) => [SQL_RESULT_SET_CONCURRENCY_UPDATABLE]
735 * - return 5 (\b101) => [SQL_RESULT_SET_CONCURRENCY_UNSPECIFIED, SQL_RESULT_SET_CONCURRENCY_UPDATABLE]
736 * - return 6 (\b110) => [SQL_RESULT_SET_CONCURRENCY_READ_ONLY, SQL_RESULT_SET_CONCURRENCY_UPDATABLE]
737 * - return 7 (\b111) => [SQL_RESULT_SET_CONCURRENCY_UNSPECIFIED, SQL_RESULT_SET_CONCURRENCY_READ_ONLY, SQL_RESULT_SET_CONCURRENCY_UPDATABLE]
738 * Valid result set types are described under `arrow.flight.protocol.sql.SqlSupportedResultSetConcurrency`.
739 */
740 SQL_SUPPORTED_CONCURRENCIES_FOR_RESULT_SET_UNSPECIFIED = 568;
741
742 /*
743 * Returns an int32 bitmask value concurrency types supported for
744 * `arrow.flight.protocol.sql.SqlSupportedResultSetType.SQL_RESULT_SET_TYPE_FORWARD_ONLY`.
745 *
746 * For instance:
747 * - return 0 (\b0) => [] (no supported concurrency types for this result set type)
748 * - return 1 (\b1) => [SQL_RESULT_SET_CONCURRENCY_UNSPECIFIED]
749 * - return 2 (\b10) => [SQL_RESULT_SET_CONCURRENCY_READ_ONLY]
750 * - return 3 (\b11) => [SQL_RESULT_SET_CONCURRENCY_UNSPECIFIED, SQL_RESULT_SET_CONCURRENCY_READ_ONLY]
751 * - return 4 (\b100) => [SQL_RESULT_SET_CONCURRENCY_UPDATABLE]
752 * - return 5 (\b101) => [SQL_RESULT_SET_CONCURRENCY_UNSPECIFIED, SQL_RESULT_SET_CONCURRENCY_UPDATABLE]
753 * - return 6 (\b110) => [SQL_RESULT_SET_CONCURRENCY_READ_ONLY, SQL_RESULT_SET_CONCURRENCY_UPDATABLE]
754 * - return 7 (\b111) => [SQL_RESULT_SET_CONCURRENCY_UNSPECIFIED, SQL_RESULT_SET_CONCURRENCY_READ_ONLY, SQL_RESULT_SET_CONCURRENCY_UPDATABLE]
755 * Valid result set types are described under `arrow.flight.protocol.sql.SqlSupportedResultSetConcurrency`.
756 */
757 SQL_SUPPORTED_CONCURRENCIES_FOR_RESULT_SET_FORWARD_ONLY = 569;
758
759 /*
760 * Returns an int32 bitmask value concurrency types supported for
761 * `arrow.flight.protocol.sql.SqlSupportedResultSetType.SQL_RESULT_SET_TYPE_SCROLL_SENSITIVE`.
762 *
763 * For instance:
764 * - return 0 (\b0) => [] (no supported concurrency types for this result set type)
765 * - return 1 (\b1) => [SQL_RESULT_SET_CONCURRENCY_UNSPECIFIED]
766 * - return 2 (\b10) => [SQL_RESULT_SET_CONCURRENCY_READ_ONLY]
767 * - return 3 (\b11) => [SQL_RESULT_SET_CONCURRENCY_UNSPECIFIED, SQL_RESULT_SET_CONCURRENCY_READ_ONLY]
768 * - return 4 (\b100) => [SQL_RESULT_SET_CONCURRENCY_UPDATABLE]
769 * - return 5 (\b101) => [SQL_RESULT_SET_CONCURRENCY_UNSPECIFIED, SQL_RESULT_SET_CONCURRENCY_UPDATABLE]
770 * - return 6 (\b110) => [SQL_RESULT_SET_CONCURRENCY_READ_ONLY, SQL_RESULT_SET_CONCURRENCY_UPDATABLE]
771 * - return 7 (\b111) => [SQL_RESULT_SET_CONCURRENCY_UNSPECIFIED, SQL_RESULT_SET_CONCURRENCY_READ_ONLY, SQL_RESULT_SET_CONCURRENCY_UPDATABLE]
772 * Valid result set types are described under `arrow.flight.protocol.sql.SqlSupportedResultSetConcurrency`.
773 */
774 SQL_SUPPORTED_CONCURRENCIES_FOR_RESULT_SET_SCROLL_SENSITIVE = 570;
775
776 /*
777 * Returns an int32 bitmask value concurrency types supported for
778 * `arrow.flight.protocol.sql.SqlSupportedResultSetType.SQL_RESULT_SET_TYPE_SCROLL_INSENSITIVE`.
779 *
780 * For instance:
781 * - return 0 (\b0) => [] (no supported concurrency types for this result set type)
782 * - return 1 (\b1) => [SQL_RESULT_SET_CONCURRENCY_UNSPECIFIED]
783 * - return 2 (\b10) => [SQL_RESULT_SET_CONCURRENCY_READ_ONLY]
784 * - return 3 (\b11) => [SQL_RESULT_SET_CONCURRENCY_UNSPECIFIED, SQL_RESULT_SET_CONCURRENCY_READ_ONLY]
785 * - return 4 (\b100) => [SQL_RESULT_SET_CONCURRENCY_UPDATABLE]
786 * - return 5 (\b101) => [SQL_RESULT_SET_CONCURRENCY_UNSPECIFIED, SQL_RESULT_SET_CONCURRENCY_UPDATABLE]
787 * - return 6 (\b110) => [SQL_RESULT_SET_CONCURRENCY_READ_ONLY, SQL_RESULT_SET_CONCURRENCY_UPDATABLE]
788 * - return 7 (\b111) => [SQL_RESULT_SET_CONCURRENCY_UNSPECIFIED, SQL_RESULT_SET_CONCURRENCY_READ_ONLY, SQL_RESULT_SET_CONCURRENCY_UPDATABLE]
789 * Valid result set types are described under `arrow.flight.protocol.sql.SqlSupportedResultSetConcurrency`.
790 */
791 SQL_SUPPORTED_CONCURRENCIES_FOR_RESULT_SET_SCROLL_INSENSITIVE = 571;
792
793 /*
794 * Retrieves a boolean value indicating whether this database supports batch updates.
795 *
796 * - false: if this database does not support batch updates;
797 * - true: if this database supports batch updates.
798 */
799 SQL_BATCH_UPDATES_SUPPORTED = 572;
800
801 /*
802 * Retrieves a boolean value indicating whether this database supports savepoints.
803 *
804 * Returns:
805 * - false: if this database does not support savepoints;
806 * - true: if this database supports savepoints.
807 */
808 SQL_SAVEPOINTS_SUPPORTED = 573;
809
810 /*
811 * Retrieves a boolean value indicating whether named parameters are supported in callable statements.
812 *
813 * Returns:
814 * - false: if named parameters in callable statements are unsupported;
815 * - true: if named parameters in callable statements are supported.
816 */
817 SQL_NAMED_PARAMETERS_SUPPORTED = 574;
818
819 /*
820 * Retrieves a boolean value indicating whether updates made to a LOB are made on a copy or directly to the LOB.
821 *
822 * Returns:
823 * - false: if updates made to a LOB are made directly to the LOB;
824 * - true: if updates made to a LOB are made on a copy.
825 */
826 SQL_LOCATORS_UPDATE_COPY = 575;
827
828 /*
829 * Retrieves a boolean value indicating whether invoking user-defined or vendor functions
830 * using the stored procedure escape syntax is supported.
831 *
832 * Returns:
833 * - false: if invoking user-defined or vendor functions using the stored procedure escape syntax is unsupported;
834 * - true: if invoking user-defined or vendor functions using the stored procedure escape syntax is supported.
835 */
836 SQL_STORED_FUNCTIONS_USING_CALL_SYNTAX_SUPPORTED = 576;
837}
838
839// The level of support for Flight SQL transaction RPCs.
840enum SqlSupportedTransaction {
841 // Unknown/not indicated/no support
842 SQL_SUPPORTED_TRANSACTION_NONE = 0;
843 // Transactions, but not savepoints.
844 // A savepoint is a mark within a transaction that can be individually
845 // rolled back to. Not all databases support savepoints.
846 SQL_SUPPORTED_TRANSACTION_TRANSACTION = 1;
847 // Transactions and savepoints
848 SQL_SUPPORTED_TRANSACTION_SAVEPOINT = 2;
849}
850
851enum SqlSupportedCaseSensitivity {
852 SQL_CASE_SENSITIVITY_UNKNOWN = 0;
853 SQL_CASE_SENSITIVITY_CASE_INSENSITIVE = 1;
854 SQL_CASE_SENSITIVITY_UPPERCASE = 2;
855 SQL_CASE_SENSITIVITY_LOWERCASE = 3;
856}
857
858enum SqlNullOrdering {
859 SQL_NULLS_SORTED_HIGH = 0;
860 SQL_NULLS_SORTED_LOW = 1;
861 SQL_NULLS_SORTED_AT_START = 2;
862 SQL_NULLS_SORTED_AT_END = 3;
863}
864
865enum SupportedSqlGrammar {
866 SQL_MINIMUM_GRAMMAR = 0;
867 SQL_CORE_GRAMMAR = 1;
868 SQL_EXTENDED_GRAMMAR = 2;
869}
870
871enum SupportedAnsi92SqlGrammarLevel {
872 ANSI92_ENTRY_SQL = 0;
873 ANSI92_INTERMEDIATE_SQL = 1;
874 ANSI92_FULL_SQL = 2;
875}
876
877enum SqlOuterJoinsSupportLevel {
878 SQL_JOINS_UNSUPPORTED = 0;
879 SQL_LIMITED_OUTER_JOINS = 1;
880 SQL_FULL_OUTER_JOINS = 2;
881}
882
883enum SqlSupportedGroupBy {
884 SQL_GROUP_BY_UNRELATED = 0;
885 SQL_GROUP_BY_BEYOND_SELECT = 1;
886}
887
888enum SqlSupportedElementActions {
889 SQL_ELEMENT_IN_PROCEDURE_CALLS = 0;
890 SQL_ELEMENT_IN_INDEX_DEFINITIONS = 1;
891 SQL_ELEMENT_IN_PRIVILEGE_DEFINITIONS = 2;
892}
893
894enum SqlSupportedPositionedCommands {
895 SQL_POSITIONED_DELETE = 0;
896 SQL_POSITIONED_UPDATE = 1;
897}
898
899enum SqlSupportedSubqueries {
900 SQL_SUBQUERIES_IN_COMPARISONS = 0;
901 SQL_SUBQUERIES_IN_EXISTS = 1;
902 SQL_SUBQUERIES_IN_INS = 2;
903 SQL_SUBQUERIES_IN_QUANTIFIEDS = 3;
904}
905
906enum SqlSupportedUnions {
907 SQL_UNION = 0;
908 SQL_UNION_ALL = 1;
909}
910
911enum SqlTransactionIsolationLevel {
912 SQL_TRANSACTION_NONE = 0;
913 SQL_TRANSACTION_READ_UNCOMMITTED = 1;
914 SQL_TRANSACTION_READ_COMMITTED = 2;
915 SQL_TRANSACTION_REPEATABLE_READ = 3;
916 SQL_TRANSACTION_SERIALIZABLE = 4;
917}
918
919enum SqlSupportedTransactions {
920 SQL_TRANSACTION_UNSPECIFIED = 0;
921 SQL_DATA_DEFINITION_TRANSACTIONS = 1;
922 SQL_DATA_MANIPULATION_TRANSACTIONS = 2;
923}
924
925enum SqlSupportedResultSetType {
926 SQL_RESULT_SET_TYPE_UNSPECIFIED = 0;
927 SQL_RESULT_SET_TYPE_FORWARD_ONLY = 1;
928 SQL_RESULT_SET_TYPE_SCROLL_INSENSITIVE = 2;
929 SQL_RESULT_SET_TYPE_SCROLL_SENSITIVE = 3;
930}
931
932enum SqlSupportedResultSetConcurrency {
933 SQL_RESULT_SET_CONCURRENCY_UNSPECIFIED = 0;
934 SQL_RESULT_SET_CONCURRENCY_READ_ONLY = 1;
935 SQL_RESULT_SET_CONCURRENCY_UPDATABLE = 2;
936}
937
938enum SqlSupportsConvert {
939 SQL_CONVERT_BIGINT = 0;
940 SQL_CONVERT_BINARY = 1;
941 SQL_CONVERT_BIT = 2;
942 SQL_CONVERT_CHAR = 3;
943 SQL_CONVERT_DATE = 4;
944 SQL_CONVERT_DECIMAL = 5;
945 SQL_CONVERT_FLOAT = 6;
946 SQL_CONVERT_INTEGER = 7;
947 SQL_CONVERT_INTERVAL_DAY_TIME = 8;
948 SQL_CONVERT_INTERVAL_YEAR_MONTH = 9;
949 SQL_CONVERT_LONGVARBINARY = 10;
950 SQL_CONVERT_LONGVARCHAR = 11;
951 SQL_CONVERT_NUMERIC = 12;
952 SQL_CONVERT_REAL = 13;
953 SQL_CONVERT_SMALLINT = 14;
954 SQL_CONVERT_TIME = 15;
955 SQL_CONVERT_TIMESTAMP = 16;
956 SQL_CONVERT_TINYINT = 17;
957 SQL_CONVERT_VARBINARY = 18;
958 SQL_CONVERT_VARCHAR = 19;
959}
960
961/**
962 * The JDBC/ODBC-defined type of any object.
963 * All the values here are the same as in the JDBC and ODBC specs.
964 */
965enum XdbcDataType {
966 XDBC_UNKNOWN_TYPE = 0;
967 XDBC_CHAR = 1;
968 XDBC_NUMERIC = 2;
969 XDBC_DECIMAL = 3;
970 XDBC_INTEGER = 4;
971 XDBC_SMALLINT = 5;
972 XDBC_FLOAT = 6;
973 XDBC_REAL = 7;
974 XDBC_DOUBLE = 8;
975 XDBC_DATETIME = 9;
976 XDBC_INTERVAL = 10;
977 XDBC_VARCHAR = 12;
978 XDBC_DATE = 91;
979 XDBC_TIME = 92;
980 XDBC_TIMESTAMP = 93;
981 XDBC_LONGVARCHAR = -1;
982 XDBC_BINARY = -2;
983 XDBC_VARBINARY = -3;
984 XDBC_LONGVARBINARY = -4;
985 XDBC_BIGINT = -5;
986 XDBC_TINYINT = -6;
987 XDBC_BIT = -7;
988 XDBC_WCHAR = -8;
989 XDBC_WVARCHAR = -9;
990}
991
992/**
993 * Detailed subtype information for XDBC_TYPE_DATETIME and XDBC_TYPE_INTERVAL.
994 */
995enum XdbcDatetimeSubcode {
996 option allow_alias = true;
997 XDBC_SUBCODE_UNKNOWN = 0;
998 XDBC_SUBCODE_YEAR = 1;
999 XDBC_SUBCODE_DATE = 1;
1000 XDBC_SUBCODE_TIME = 2;
1001 XDBC_SUBCODE_MONTH = 2;
1002 XDBC_SUBCODE_TIMESTAMP = 3;
1003 XDBC_SUBCODE_DAY = 3;
1004 XDBC_SUBCODE_TIME_WITH_TIMEZONE = 4;
1005 XDBC_SUBCODE_HOUR = 4;
1006 XDBC_SUBCODE_TIMESTAMP_WITH_TIMEZONE = 5;
1007 XDBC_SUBCODE_MINUTE = 5;
1008 XDBC_SUBCODE_SECOND = 6;
1009 XDBC_SUBCODE_YEAR_TO_MONTH = 7;
1010 XDBC_SUBCODE_DAY_TO_HOUR = 8;
1011 XDBC_SUBCODE_DAY_TO_MINUTE = 9;
1012 XDBC_SUBCODE_DAY_TO_SECOND = 10;
1013 XDBC_SUBCODE_HOUR_TO_MINUTE = 11;
1014 XDBC_SUBCODE_HOUR_TO_SECOND = 12;
1015 XDBC_SUBCODE_MINUTE_TO_SECOND = 13;
1016 XDBC_SUBCODE_INTERVAL_YEAR = 101;
1017 XDBC_SUBCODE_INTERVAL_MONTH = 102;
1018 XDBC_SUBCODE_INTERVAL_DAY = 103;
1019 XDBC_SUBCODE_INTERVAL_HOUR = 104;
1020 XDBC_SUBCODE_INTERVAL_MINUTE = 105;
1021 XDBC_SUBCODE_INTERVAL_SECOND = 106;
1022 XDBC_SUBCODE_INTERVAL_YEAR_TO_MONTH = 107;
1023 XDBC_SUBCODE_INTERVAL_DAY_TO_HOUR = 108;
1024 XDBC_SUBCODE_INTERVAL_DAY_TO_MINUTE = 109;
1025 XDBC_SUBCODE_INTERVAL_DAY_TO_SECOND = 110;
1026 XDBC_SUBCODE_INTERVAL_HOUR_TO_MINUTE = 111;
1027 XDBC_SUBCODE_INTERVAL_HOUR_TO_SECOND = 112;
1028 XDBC_SUBCODE_INTERVAL_MINUTE_TO_SECOND = 113;
1029}
1030
1031enum Nullable {
1032 /**
1033 * Indicates that the fields does not allow the use of null values.
1034 */
1035 NULLABILITY_NO_NULLS = 0;
1036
1037 /**
1038 * Indicates that the fields allow the use of null values.
1039 */
1040 NULLABILITY_NULLABLE = 1;
1041
1042 /**
1043 * Indicates that nullability of the fields cannot be determined.
1044 */
1045 NULLABILITY_UNKNOWN = 2;
1046}
1047
1048enum Searchable {
1049 /**
1050 * Indicates that column cannot be used in a WHERE clause.
1051 */
1052 SEARCHABLE_NONE = 0;
1053
1054 /**
1055 * Indicates that the column can be used in a WHERE clause if it is using a
1056 * LIKE operator.
1057 */
1058 SEARCHABLE_CHAR = 1;
1059
1060 /**
1061 * Indicates that the column can be used In a WHERE clause with any
1062 * operator other than LIKE.
1063 *
1064 * - Allowed operators: comparison, quantified comparison, BETWEEN,
1065 * DISTINCT, IN, MATCH, and UNIQUE.
1066 */
1067 SEARCHABLE_BASIC = 2;
1068
1069 /**
1070 * Indicates that the column can be used in a WHERE clause using any operator.
1071 */
1072 SEARCHABLE_FULL = 3;
1073}
1074
1075/*
1076 * Represents a request to retrieve information about data type supported on a Flight SQL enabled backend.
1077 * Used in the command member of FlightDescriptor for the following RPC calls:
1078 * - GetSchema: return the schema of the query.
1079 * - GetFlightInfo: execute the catalog metadata request.
1080 *
1081 * The returned schema will be:
1082 * <
1083 * type_name: utf8 not null (The name of the data type, for example: VARCHAR, INTEGER, etc),
1084 * data_type: int32 not null (The SQL data type),
1085 * column_size: int32 (The maximum size supported by that column.
1086 * In case of exact numeric types, this represents the maximum precision.
1087 * In case of string types, this represents the character length.
1088 * In case of datetime data types, this represents the length in characters of the string representation.
1089 * NULL is returned for data types where column size is not applicable.),
1090 * literal_prefix: utf8 (Character or characters used to prefix a literal, NULL is returned for
1091 * data types where a literal prefix is not applicable.),
1092 * literal_suffix: utf8 (Character or characters used to terminate a literal,
1093 * NULL is returned for data types where a literal suffix is not applicable.),
1094 * create_params: list<utf8 not null>
1095 * (A list of keywords corresponding to which parameters can be used when creating
1096 * a column for that specific type.
1097 * NULL is returned if there are no parameters for the data type definition.),
1098 * nullable: int32 not null (Shows if the data type accepts a NULL value. The possible values can be seen in the
1099 * Nullable enum.),
1100 * case_sensitive: bool not null (Shows if a character data type is case-sensitive in collations and comparisons),
1101 * searchable: int32 not null (Shows how the data type is used in a WHERE clause. The possible values can be seen in the
1102 * Searchable enum.),
1103 * unsigned_attribute: bool (Shows if the data type is unsigned. NULL is returned if the attribute is
1104 * not applicable to the data type or the data type is not numeric.),
1105 * fixed_prec_scale: bool not null (Shows if the data type has predefined fixed precision and scale.),
1106 * auto_increment: bool (Shows if the data type is auto incremental. NULL is returned if the attribute
1107 * is not applicable to the data type or the data type is not numeric.),
1108 * local_type_name: utf8 (Localized version of the data source-dependent name of the data type. NULL
1109 * is returned if a localized name is not supported by the data source),
1110 * minimum_scale: int32 (The minimum scale of the data type on the data source.
1111 * If a data type has a fixed scale, the MINIMUM_SCALE and MAXIMUM_SCALE
1112 * columns both contain this value. NULL is returned if scale is not applicable.),
1113 * maximum_scale: int32 (The maximum scale of the data type on the data source.
1114 * NULL is returned if scale is not applicable.),
1115 * sql_data_type: int32 not null (The value of the SQL DATA TYPE which has the same values
1116 * as data_type value. Except for interval and datetime, which
1117 * uses generic values. More info about those types can be
1118 * obtained through datetime_subcode. The possible values can be seen
1119 * in the XdbcDataType enum.),
1120 * datetime_subcode: int32 (Only used when the SQL DATA TYPE is interval or datetime. It contains
1121 * its sub types. For type different from interval and datetime, this value
1122 * is NULL. The possible values can be seen in the XdbcDatetimeSubcode enum.),
1123 * num_prec_radix: int32 (If the data type is an approximate numeric type, this column contains
1124 * the value 2 to indicate that COLUMN_SIZE specifies a number of bits. For
1125 * exact numeric types, this column contains the value 10 to indicate that
1126 * column size specifies a number of decimal digits. Otherwise, this column is NULL.),
1127 * interval_precision: int32 (If the data type is an interval data type, then this column contains the value
1128 * of the interval leading precision. Otherwise, this column is NULL. This fields
1129 * is only relevant to be used by ODBC).
1130 * >
1131 * The returned data should be ordered by data_type and then by type_name.
1132 */
1133message CommandGetXdbcTypeInfo {
1134 option (experimental) = true;
1135
1136 /*
1137 * Specifies the data type to search for the info.
1138 */
1139 optional int32 data_type = 1;
1140}
1141
1142/*
1143 * Represents a request to retrieve the list of catalogs on a Flight SQL enabled backend.
1144 * The definition of a catalog depends on vendor/implementation. It is usually the database itself
1145 * Used in the command member of FlightDescriptor for the following RPC calls:
1146 * - GetSchema: return the Arrow schema of the query.
1147 * - GetFlightInfo: execute the catalog metadata request.
1148 *
1149 * The returned Arrow schema will be:
1150 * <
1151 * catalog_name: utf8 not null
1152 * >
1153 * The returned data should be ordered by catalog_name.
1154 */
1155message CommandGetCatalogs {
1156 option (experimental) = true;
1157}
1158
1159/*
1160 * Represents a request to retrieve the list of database schemas on a Flight SQL enabled backend.
1161 * The definition of a database schema depends on vendor/implementation. It is usually a collection of tables.
1162 * Used in the command member of FlightDescriptor for the following RPC calls:
1163 * - GetSchema: return the Arrow schema of the query.
1164 * - GetFlightInfo: execute the catalog metadata request.
1165 *
1166 * The returned Arrow schema will be:
1167 * <
1168 * catalog_name: utf8,
1169 * db_schema_name: utf8 not null
1170 * >
1171 * The returned data should be ordered by catalog_name, then db_schema_name.
1172 */
1173message CommandGetDbSchemas {
1174 option (experimental) = true;
1175
1176 /*
1177 * Specifies the Catalog to search for the tables.
1178 * An empty string retrieves those without a catalog.
1179 * If omitted the catalog name should not be used to narrow the search.
1180 */
1181 optional string catalog = 1;
1182
1183 /*
1184 * Specifies a filter pattern for schemas to search for.
1185 * When no db_schema_filter_pattern is provided, the pattern will not be used to narrow the search.
1186 * In the pattern string, two special characters can be used to denote matching rules:
1187 * - "%" means to match any substring with 0 or more characters.
1188 * - "_" means to match any one character.
1189 */
1190 optional string db_schema_filter_pattern = 2;
1191}
1192
1193/*
1194 * Represents a request to retrieve the list of tables, and optionally their schemas, on a Flight SQL enabled backend.
1195 * Used in the command member of FlightDescriptor for the following RPC calls:
1196 * - GetSchema: return the Arrow schema of the query.
1197 * - GetFlightInfo: execute the catalog metadata request.
1198 *
1199 * The returned Arrow schema will be:
1200 * <
1201 * catalog_name: utf8,
1202 * db_schema_name: utf8,
1203 * table_name: utf8 not null,
1204 * table_type: utf8 not null,
1205 * [optional] table_schema: bytes not null (schema of the table as described in Schema.fbs::Schema,
1206 * it is serialized as an IPC message.)
1207 * >
1208 * Fields on table_schema may contain the following metadata:
1209 * - ARROW:FLIGHT:SQL:CATALOG_NAME - Table's catalog name
1210 * - ARROW:FLIGHT:SQL:DB_SCHEMA_NAME - Database schema name
1211 * - ARROW:FLIGHT:SQL:TABLE_NAME - Table name
1212 * - ARROW:FLIGHT:SQL:TYPE_NAME - The data source-specific name for the data type of the column.
1213 * - ARROW:FLIGHT:SQL:PRECISION - Column precision/size
1214 * - ARROW:FLIGHT:SQL:SCALE - Column scale/decimal digits if applicable
1215 * - ARROW:FLIGHT:SQL:IS_AUTO_INCREMENT - "1" indicates if the column is auto incremented, "0" otherwise.
1216 * - ARROW:FLIGHT:SQL:IS_CASE_SENSITIVE - "1" indicates if the column is case-sensitive, "0" otherwise.
1217 * - ARROW:FLIGHT:SQL:IS_READ_ONLY - "1" indicates if the column is read only, "0" otherwise.
1218 * - ARROW:FLIGHT:SQL:IS_SEARCHABLE - "1" indicates if the column is searchable via WHERE clause, "0" otherwise.
1219 * The returned data should be ordered by catalog_name, db_schema_name, table_name, then table_type, followed by table_schema if requested.
1220 */
1221message CommandGetTables {
1222 option (experimental) = true;
1223
1224 /*
1225 * Specifies the Catalog to search for the tables.
1226 * An empty string retrieves those without a catalog.
1227 * If omitted the catalog name should not be used to narrow the search.
1228 */
1229 optional string catalog = 1;
1230
1231 /*
1232 * Specifies a filter pattern for schemas to search for.
1233 * When no db_schema_filter_pattern is provided, all schemas matching other filters are searched.
1234 * In the pattern string, two special characters can be used to denote matching rules:
1235 * - "%" means to match any substring with 0 or more characters.
1236 * - "_" means to match any one character.
1237 */
1238 optional string db_schema_filter_pattern = 2;
1239
1240 /*
1241 * Specifies a filter pattern for tables to search for.
1242 * When no table_name_filter_pattern is provided, all tables matching other filters are searched.
1243 * In the pattern string, two special characters can be used to denote matching rules:
1244 * - "%" means to match any substring with 0 or more characters.
1245 * - "_" means to match any one character.
1246 */
1247 optional string table_name_filter_pattern = 3;
1248
1249 /*
1250 * Specifies a filter of table types which must match.
1251 * The table types depend on vendor/implementation. It is usually used to separate tables from views or system tables.
1252 * TABLE, VIEW, and SYSTEM TABLE are commonly supported.
1253 */
1254 repeated string table_types = 4;
1255
1256 // Specifies if the Arrow schema should be returned for found tables.
1257 bool include_schema = 5;
1258}
1259
1260/*
1261 * Represents a request to retrieve the list of table types on a Flight SQL enabled backend.
1262 * The table types depend on vendor/implementation. It is usually used to separate tables from views or system tables.
1263 * TABLE, VIEW, and SYSTEM TABLE are commonly supported.
1264 * Used in the command member of FlightDescriptor for the following RPC calls:
1265 * - GetSchema: return the Arrow schema of the query.
1266 * - GetFlightInfo: execute the catalog metadata request.
1267 *
1268 * The returned Arrow schema will be:
1269 * <
1270 * table_type: utf8 not null
1271 * >
1272 * The returned data should be ordered by table_type.
1273 */
1274message CommandGetTableTypes {
1275 option (experimental) = true;
1276}
1277
1278/*
1279 * Represents a request to retrieve the primary keys of a table on a Flight SQL enabled backend.
1280 * Used in the command member of FlightDescriptor for the following RPC calls:
1281 * - GetSchema: return the Arrow schema of the query.
1282 * - GetFlightInfo: execute the catalog metadata request.
1283 *
1284 * The returned Arrow schema will be:
1285 * <
1286 * catalog_name: utf8,
1287 * db_schema_name: utf8,
1288 * table_name: utf8 not null,
1289 * column_name: utf8 not null,
1290 * key_name: utf8,
1291 * key_sequence: int32 not null
1292 * >
1293 * The returned data should be ordered by catalog_name, db_schema_name, table_name, key_name, then key_sequence.
1294 */
1295message CommandGetPrimaryKeys {
1296 option (experimental) = true;
1297
1298 /*
1299 * Specifies the catalog to search for the table.
1300 * An empty string retrieves those without a catalog.
1301 * If omitted the catalog name should not be used to narrow the search.
1302 */
1303 optional string catalog = 1;
1304
1305 /*
1306 * Specifies the schema to search for the table.
1307 * An empty string retrieves those without a schema.
1308 * If omitted the schema name should not be used to narrow the search.
1309 */
1310 optional string db_schema = 2;
1311
1312 // Specifies the table to get the primary keys for.
1313 string table = 3;
1314}
1315
1316enum UpdateDeleteRules {
1317 CASCADE = 0;
1318 RESTRICT = 1;
1319 SET_NULL = 2;
1320 NO_ACTION = 3;
1321 SET_DEFAULT = 4;
1322}
1323
1324/*
1325 * Represents a request to retrieve a description of the foreign key columns that reference the given table's
1326 * primary key columns (the foreign keys exported by a table) of a table on a Flight SQL enabled backend.
1327 * Used in the command member of FlightDescriptor for the following RPC calls:
1328 * - GetSchema: return the Arrow schema of the query.
1329 * - GetFlightInfo: execute the catalog metadata request.
1330 *
1331 * The returned Arrow schema will be:
1332 * <
1333 * pk_catalog_name: utf8,
1334 * pk_db_schema_name: utf8,
1335 * pk_table_name: utf8 not null,
1336 * pk_column_name: utf8 not null,
1337 * fk_catalog_name: utf8,
1338 * fk_db_schema_name: utf8,
1339 * fk_table_name: utf8 not null,
1340 * fk_column_name: utf8 not null,
1341 * key_sequence: int32 not null,
1342 * fk_key_name: utf8,
1343 * pk_key_name: utf8,
1344 * update_rule: uint8 not null,
1345 * delete_rule: uint8 not null
1346 * >
1347 * The returned data should be ordered by fk_catalog_name, fk_db_schema_name, fk_table_name, fk_key_name, then key_sequence.
1348 * update_rule and delete_rule returns a byte that is equivalent to actions declared on UpdateDeleteRules enum.
1349 */
1350message CommandGetExportedKeys {
1351 option (experimental) = true;
1352
1353 /*
1354 * Specifies the catalog to search for the foreign key table.
1355 * An empty string retrieves those without a catalog.
1356 * If omitted the catalog name should not be used to narrow the search.
1357 */
1358 optional string catalog = 1;
1359
1360 /*
1361 * Specifies the schema to search for the foreign key table.
1362 * An empty string retrieves those without a schema.
1363 * If omitted the schema name should not be used to narrow the search.
1364 */
1365 optional string db_schema = 2;
1366
1367 // Specifies the foreign key table to get the foreign keys for.
1368 string table = 3;
1369}
1370
1371/*
1372 * Represents a request to retrieve the foreign keys of a table on a Flight SQL enabled backend.
1373 * Used in the command member of FlightDescriptor for the following RPC calls:
1374 * - GetSchema: return the Arrow schema of the query.
1375 * - GetFlightInfo: execute the catalog metadata request.
1376 *
1377 * The returned Arrow schema will be:
1378 * <
1379 * pk_catalog_name: utf8,
1380 * pk_db_schema_name: utf8,
1381 * pk_table_name: utf8 not null,
1382 * pk_column_name: utf8 not null,
1383 * fk_catalog_name: utf8,
1384 * fk_db_schema_name: utf8,
1385 * fk_table_name: utf8 not null,
1386 * fk_column_name: utf8 not null,
1387 * key_sequence: int32 not null,
1388 * fk_key_name: utf8,
1389 * pk_key_name: utf8,
1390 * update_rule: uint8 not null,
1391 * delete_rule: uint8 not null
1392 * >
1393 * The returned data should be ordered by pk_catalog_name, pk_db_schema_name, pk_table_name, pk_key_name, then key_sequence.
1394 * update_rule and delete_rule returns a byte that is equivalent to actions:
1395 * - 0 = CASCADE
1396 * - 1 = RESTRICT
1397 * - 2 = SET NULL
1398 * - 3 = NO ACTION
1399 * - 4 = SET DEFAULT
1400 */
1401message CommandGetImportedKeys {
1402 option (experimental) = true;
1403
1404 /*
1405 * Specifies the catalog to search for the primary key table.
1406 * An empty string retrieves those without a catalog.
1407 * If omitted the catalog name should not be used to narrow the search.
1408 */
1409 optional string catalog = 1;
1410
1411 /*
1412 * Specifies the schema to search for the primary key table.
1413 * An empty string retrieves those without a schema.
1414 * If omitted the schema name should not be used to narrow the search.
1415 */
1416 optional string db_schema = 2;
1417
1418 // Specifies the primary key table to get the foreign keys for.
1419 string table = 3;
1420}
1421
1422/*
1423 * Represents a request to retrieve a description of the foreign key columns in the given foreign key table that
1424 * reference the primary key or the columns representing a unique constraint of the parent table (could be the same
1425 * or a different table) on a Flight SQL enabled backend.
1426 * Used in the command member of FlightDescriptor for the following RPC calls:
1427 * - GetSchema: return the Arrow schema of the query.
1428 * - GetFlightInfo: execute the catalog metadata request.
1429 *
1430 * The returned Arrow schema will be:
1431 * <
1432 * pk_catalog_name: utf8,
1433 * pk_db_schema_name: utf8,
1434 * pk_table_name: utf8 not null,
1435 * pk_column_name: utf8 not null,
1436 * fk_catalog_name: utf8,
1437 * fk_db_schema_name: utf8,
1438 * fk_table_name: utf8 not null,
1439 * fk_column_name: utf8 not null,
1440 * key_sequence: int32 not null,
1441 * fk_key_name: utf8,
1442 * pk_key_name: utf8,
1443 * update_rule: uint8 not null,
1444 * delete_rule: uint8 not null
1445 * >
1446 * The returned data should be ordered by pk_catalog_name, pk_db_schema_name, pk_table_name, pk_key_name, then key_sequence.
1447 * update_rule and delete_rule returns a byte that is equivalent to actions:
1448 * - 0 = CASCADE
1449 * - 1 = RESTRICT
1450 * - 2 = SET NULL
1451 * - 3 = NO ACTION
1452 * - 4 = SET DEFAULT
1453 */
1454message CommandGetCrossReference {
1455 option (experimental) = true;
1456
1457 /**
1458 * The catalog name where the parent table is.
1459 * An empty string retrieves those without a catalog.
1460 * If omitted the catalog name should not be used to narrow the search.
1461 */
1462 optional string pk_catalog = 1;
1463
1464 /**
1465 * The Schema name where the parent table is.
1466 * An empty string retrieves those without a schema.
1467 * If omitted the schema name should not be used to narrow the search.
1468 */
1469 optional string pk_db_schema = 2;
1470
1471 /**
1472 * The parent table name. It cannot be null.
1473 */
1474 string pk_table = 3;
1475
1476 /**
1477 * The catalog name where the foreign table is.
1478 * An empty string retrieves those without a catalog.
1479 * If omitted the catalog name should not be used to narrow the search.
1480 */
1481 optional string fk_catalog = 4;
1482
1483 /**
1484 * The schema name where the foreign table is.
1485 * An empty string retrieves those without a schema.
1486 * If omitted the schema name should not be used to narrow the search.
1487 */
1488 optional string fk_db_schema = 5;
1489
1490 /**
1491 * The foreign table name. It cannot be null.
1492 */
1493 string fk_table = 6;
1494}
1495
1496// Query Execution Action Messages
1497
1498/*
1499 * Request message for the "CreatePreparedStatement" action on a Flight SQL enabled backend.
1500 */
1501message ActionCreatePreparedStatementRequest {
1502 option (experimental) = true;
1503
1504 // The valid SQL string to create a prepared statement for.
1505 string query = 1;
1506 // Create/execute the prepared statement as part of this transaction (if
1507 // unset, executions of the prepared statement will be auto-committed).
1508 optional bytes transaction_id = 2;
1509}
1510
1511/*
1512 * An embedded message describing a Substrait plan to execute.
1513 */
1514message SubstraitPlan {
1515 option (experimental) = true;
1516
1517 // The serialized substrait.Plan to create a prepared statement for.
1518 // XXX(ARROW-16902): this is bytes instead of an embedded message
1519 // because Protobuf does not really support one DLL using Protobuf
1520 // definitions from another DLL.
1521 bytes plan = 1;
1522 // The Substrait release, e.g. "0.12.0". This information is not
1523 // tracked in the plan itself, so this is the only way for consumers
1524 // to potentially know if they can handle the plan.
1525 string version = 2;
1526}
1527
1528/*
1529 * Request message for the "CreatePreparedSubstraitPlan" action on a Flight SQL enabled backend.
1530 */
1531message ActionCreatePreparedSubstraitPlanRequest {
1532 option (experimental) = true;
1533
1534 // The serialized substrait.Plan to create a prepared statement for.
1535 SubstraitPlan plan = 1;
1536 // Create/execute the prepared statement as part of this transaction (if
1537 // unset, executions of the prepared statement will be auto-committed).
1538 optional bytes transaction_id = 2;
1539}
1540
1541/*
1542 * Wrap the result of a "CreatePreparedStatement" or "CreatePreparedSubstraitPlan" action.
1543 *
1544 * The resultant PreparedStatement can be closed either:
1545 * - Manually, through the "ClosePreparedStatement" action;
1546 * - Automatically, by a server timeout.
1547 *
1548 * The result should be wrapped in a google.protobuf.Any message.
1549 */
1550message ActionCreatePreparedStatementResult {
1551 option (experimental) = true;
1552
1553 // Opaque handle for the prepared statement on the server.
1554 bytes prepared_statement_handle = 1;
1555
1556 // If a result set generating query was provided, dataset_schema contains the
1557 // schema of the result set. It should be an IPC-encapsulated Schema, as described in Schema.fbs.
1558 // For some queries, the schema of the results may depend on the schema of the parameters. The server
1559 // should provide its best guess as to the schema at this point. Clients must not assume that this
1560 // schema, if provided, will be accurate.
1561 bytes dataset_schema = 2;
1562
1563 // If the query provided contained parameters, parameter_schema contains the
1564 // schema of the expected parameters. It should be an IPC-encapsulated Schema, as described in Schema.fbs.
1565 bytes parameter_schema = 3;
1566}
1567
1568/*
1569 * Request message for the "ClosePreparedStatement" action on a Flight SQL enabled backend.
1570 * Closes server resources associated with the prepared statement handle.
1571 */
1572message ActionClosePreparedStatementRequest {
1573 option (experimental) = true;
1574
1575 // Opaque handle for the prepared statement on the server.
1576 bytes prepared_statement_handle = 1;
1577}
1578
1579/*
1580 * Request message for the "BeginTransaction" action.
1581 * Begins a transaction.
1582 */
1583message ActionBeginTransactionRequest {
1584 option (experimental) = true;
1585}
1586
1587/*
1588 * Request message for the "BeginSavepoint" action.
1589 * Creates a savepoint within a transaction.
1590 *
1591 * Only supported if FLIGHT_SQL_TRANSACTION is
1592 * FLIGHT_SQL_TRANSACTION_SUPPORT_SAVEPOINT.
1593 */
1594message ActionBeginSavepointRequest {
1595 option (experimental) = true;
1596
1597 // The transaction to which a savepoint belongs.
1598 bytes transaction_id = 1;
1599 // Name for the savepoint.
1600 string name = 2;
1601}
1602
1603/*
1604 * The result of a "BeginTransaction" action.
1605 *
1606 * The transaction can be manipulated with the "EndTransaction" action, or
1607 * automatically via server timeout. If the transaction times out, then it is
1608 * automatically rolled back.
1609 *
1610 * The result should be wrapped in a google.protobuf.Any message.
1611 */
1612message ActionBeginTransactionResult {
1613 option (experimental) = true;
1614
1615 // Opaque handle for the transaction on the server.
1616 bytes transaction_id = 1;
1617}
1618
1619/*
1620 * The result of a "BeginSavepoint" action.
1621 *
1622 * The transaction can be manipulated with the "EndSavepoint" action.
1623 * If the associated transaction is committed, rolled back, or times
1624 * out, then the savepoint is also invalidated.
1625 *
1626 * The result should be wrapped in a google.protobuf.Any message.
1627 */
1628message ActionBeginSavepointResult {
1629 option (experimental) = true;
1630
1631 // Opaque handle for the savepoint on the server.
1632 bytes savepoint_id = 1;
1633}
1634
1635/*
1636 * Request message for the "EndTransaction" action.
1637 *
1638 * Commit (COMMIT) or rollback (ROLLBACK) the transaction.
1639 *
1640 * If the action completes successfully, the transaction handle is
1641 * invalidated, as are all associated savepoints.
1642 */
1643message ActionEndTransactionRequest {
1644 option (experimental) = true;
1645
1646 enum EndTransaction {
1647 END_TRANSACTION_UNSPECIFIED = 0;
1648 // Commit the transaction.
1649 END_TRANSACTION_COMMIT = 1;
1650 // Roll back the transaction.
1651 END_TRANSACTION_ROLLBACK = 2;
1652 }
1653 // Opaque handle for the transaction on the server.
1654 bytes transaction_id = 1;
1655 // Whether to commit/rollback the given transaction.
1656 EndTransaction action = 2;
1657}
1658
1659/*
1660 * Request message for the "EndSavepoint" action.
1661 *
1662 * Release (RELEASE) the savepoint or rollback (ROLLBACK) to the
1663 * savepoint.
1664 *
1665 * Releasing a savepoint invalidates that savepoint. Rolling back to
1666 * a savepoint does not invalidate the savepoint, but invalidates all
1667 * savepoints created after the current savepoint.
1668 */
1669message ActionEndSavepointRequest {
1670 option (experimental) = true;
1671
1672 enum EndSavepoint {
1673 END_SAVEPOINT_UNSPECIFIED = 0;
1674 // Release the savepoint.
1675 END_SAVEPOINT_RELEASE = 1;
1676 // Roll back to a savepoint.
1677 END_SAVEPOINT_ROLLBACK = 2;
1678 }
1679 // Opaque handle for the savepoint on the server.
1680 bytes savepoint_id = 1;
1681 // Whether to rollback/release the given savepoint.
1682 EndSavepoint action = 2;
1683}
1684
1685// Query Execution Messages.
1686
1687/*
1688 * Represents a SQL query. Used in the command member of FlightDescriptor
1689 * for the following RPC calls:
1690 * - GetSchema: return the Arrow schema of the query.
1691 * Fields on this schema may contain the following metadata:
1692 * - ARROW:FLIGHT:SQL:CATALOG_NAME - Table's catalog name
1693 * - ARROW:FLIGHT:SQL:DB_SCHEMA_NAME - Database schema name
1694 * - ARROW:FLIGHT:SQL:TABLE_NAME - Table name
1695 * - ARROW:FLIGHT:SQL:TYPE_NAME - The data source-specific name for the data type of the column.
1696 * - ARROW:FLIGHT:SQL:PRECISION - Column precision/size
1697 * - ARROW:FLIGHT:SQL:SCALE - Column scale/decimal digits if applicable
1698 * - ARROW:FLIGHT:SQL:IS_AUTO_INCREMENT - "1" indicates if the column is auto incremented, "0" otherwise.
1699 * - ARROW:FLIGHT:SQL:IS_CASE_SENSITIVE - "1" indicates if the column is case-sensitive, "0" otherwise.
1700 * - ARROW:FLIGHT:SQL:IS_READ_ONLY - "1" indicates if the column is read only, "0" otherwise.
1701 * - ARROW:FLIGHT:SQL:IS_SEARCHABLE - "1" indicates if the column is searchable via WHERE clause, "0" otherwise.
1702 * - GetFlightInfo: execute the query.
1703 */
1704message CommandStatementQuery {
1705 option (experimental) = true;
1706
1707 // The SQL syntax.
1708 string query = 1;
1709 // Include the query as part of this transaction (if unset, the query is auto-committed).
1710 optional bytes transaction_id = 2;
1711}
1712
1713/*
1714 * Represents a Substrait plan. Used in the command member of FlightDescriptor
1715 * for the following RPC calls:
1716 * - GetSchema: return the Arrow schema of the query.
1717 * Fields on this schema may contain the following metadata:
1718 * - ARROW:FLIGHT:SQL:CATALOG_NAME - Table's catalog name
1719 * - ARROW:FLIGHT:SQL:DB_SCHEMA_NAME - Database schema name
1720 * - ARROW:FLIGHT:SQL:TABLE_NAME - Table name
1721 * - ARROW:FLIGHT:SQL:TYPE_NAME - The data source-specific name for the data type of the column.
1722 * - ARROW:FLIGHT:SQL:PRECISION - Column precision/size
1723 * - ARROW:FLIGHT:SQL:SCALE - Column scale/decimal digits if applicable
1724 * - ARROW:FLIGHT:SQL:IS_AUTO_INCREMENT - "1" indicates if the column is auto incremented, "0" otherwise.
1725 * - ARROW:FLIGHT:SQL:IS_CASE_SENSITIVE - "1" indicates if the column is case-sensitive, "0" otherwise.
1726 * - ARROW:FLIGHT:SQL:IS_READ_ONLY - "1" indicates if the column is read only, "0" otherwise.
1727 * - ARROW:FLIGHT:SQL:IS_SEARCHABLE - "1" indicates if the column is searchable via WHERE clause, "0" otherwise.
1728 * - GetFlightInfo: execute the query.
1729 * - DoPut: execute the query.
1730 */
1731message CommandStatementSubstraitPlan {
1732 option (experimental) = true;
1733
1734 // A serialized substrait.Plan
1735 SubstraitPlan plan = 1;
1736 // Include the query as part of this transaction (if unset, the query is auto-committed).
1737 optional bytes transaction_id = 2;
1738}
1739
1740/**
1741 * Represents a ticket resulting from GetFlightInfo with a CommandStatementQuery.
1742 * This should be used only once and treated as an opaque value, that is, clients should not attempt to parse this.
1743 */
1744message TicketStatementQuery {
1745 option (experimental) = true;
1746
1747 // Unique identifier for the instance of the statement to execute.
1748 bytes statement_handle = 1;
1749}
1750
1751/*
1752 * Represents an instance of executing a prepared statement. Used in the command member of FlightDescriptor for
1753 * the following RPC calls:
1754 * - GetSchema: return the Arrow schema of the query.
1755 * Fields on this schema may contain the following metadata:
1756 * - ARROW:FLIGHT:SQL:CATALOG_NAME - Table's catalog name
1757 * - ARROW:FLIGHT:SQL:DB_SCHEMA_NAME - Database schema name
1758 * - ARROW:FLIGHT:SQL:TABLE_NAME - Table name
1759 * - ARROW:FLIGHT:SQL:TYPE_NAME - The data source-specific name for the data type of the column.
1760 * - ARROW:FLIGHT:SQL:PRECISION - Column precision/size
1761 * - ARROW:FLIGHT:SQL:SCALE - Column scale/decimal digits if applicable
1762 * - ARROW:FLIGHT:SQL:IS_AUTO_INCREMENT - "1" indicates if the column is auto incremented, "0" otherwise.
1763 * - ARROW:FLIGHT:SQL:IS_CASE_SENSITIVE - "1" indicates if the column is case-sensitive, "0" otherwise.
1764 * - ARROW:FLIGHT:SQL:IS_READ_ONLY - "1" indicates if the column is read only, "0" otherwise.
1765 * - ARROW:FLIGHT:SQL:IS_SEARCHABLE - "1" indicates if the column is searchable via WHERE clause, "0" otherwise.
1766 *
1767 * If the schema is retrieved after parameter values have been bound with DoPut, then the server should account
1768 * for the parameters when determining the schema.
1769 * - DoPut: bind parameter values. All of the bound parameter sets will be executed as a single atomic execution.
1770 * - GetFlightInfo: execute the prepared statement instance.
1771 */
1772message CommandPreparedStatementQuery {
1773 option (experimental) = true;
1774
1775 // Opaque handle for the prepared statement on the server.
1776 bytes prepared_statement_handle = 1;
1777}
1778
1779/*
1780 * Represents a SQL update query. Used in the command member of FlightDescriptor
1781 * for the RPC call DoPut to cause the server to execute the included SQL update.
1782 */
1783message CommandStatementUpdate {
1784 option (experimental) = true;
1785
1786 // The SQL syntax.
1787 string query = 1;
1788 // Include the query as part of this transaction (if unset, the query is auto-committed).
1789 optional bytes transaction_id = 2;
1790}
1791
1792/*
1793 * Represents a SQL update query. Used in the command member of FlightDescriptor
1794 * for the RPC call DoPut to cause the server to execute the included
1795 * prepared statement handle as an update.
1796 */
1797message CommandPreparedStatementUpdate {
1798 option (experimental) = true;
1799
1800 // Opaque handle for the prepared statement on the server.
1801 bytes prepared_statement_handle = 1;
1802}
1803
1804/*
1805 * Represents a bulk ingestion request. Used in the command member of FlightDescriptor
1806 * for the the RPC call DoPut to cause the server load the contents of the stream's
1807 * FlightData into the target destination.
1808 */
1809message CommandStatementIngest {
1810 option (experimental) = true;
1811
1812 // Options for table definition behavior
1813 message TableDefinitionOptions {
1814 // The action to take if the target table does not exist
1815 enum TableNotExistOption {
1816 // Do not use. Servers should error if this is specified by a client.
1817 TABLE_NOT_EXIST_OPTION_UNSPECIFIED = 0;
1818 // Create the table if it does not exist
1819 TABLE_NOT_EXIST_OPTION_CREATE = 1;
1820 // Fail if the table does not exist
1821 TABLE_NOT_EXIST_OPTION_FAIL = 2;
1822 }
1823 // The action to take if the target table already exists
1824 enum TableExistsOption {
1825 // Do not use. Servers should error if this is specified by a client.
1826 TABLE_EXISTS_OPTION_UNSPECIFIED = 0;
1827 // Fail if the table already exists
1828 TABLE_EXISTS_OPTION_FAIL = 1;
1829 // Append to the table if it already exists
1830 TABLE_EXISTS_OPTION_APPEND = 2;
1831 // Drop and recreate the table if it already exists
1832 TABLE_EXISTS_OPTION_REPLACE = 3;
1833 }
1834
1835 TableNotExistOption if_not_exist = 1;
1836 TableExistsOption if_exists = 2;
1837 }
1838
1839 // The behavior for handling the table definition.
1840 TableDefinitionOptions table_definition_options = 1;
1841 // The table to load data into.
1842 string table = 2;
1843 // The db_schema of the destination table to load data into. If unset, a backend-specific default may be used.
1844 optional string schema = 3;
1845 // The catalog of the destination table to load data into. If unset, a backend-specific default may be used.
1846 optional string catalog = 4;
1847 /*
1848 * Store ingested data in a temporary table.
1849 * The effect of setting temporary is to place the table in a backend-defined namespace, and to drop the table at the end of the session.
1850 * The namespacing may make use of a backend-specific schema and/or catalog.
1851 * The server should return an error if an explicit choice of schema or catalog is incompatible with the server's namespacing decision.
1852 */
1853 bool temporary = 5;
1854 // Perform the ingestion as part of this transaction. If specified, results should not be committed in the event of an error/cancellation.
1855 optional bytes transaction_id = 6;
1856
1857 // Future extensions to the parameters of CommandStatementIngest should be added here, at a lower index than the generic 'options' parameter.
1858
1859 // Backend-specific options.
1860 map<string, string> options = 1000;
1861}
1862
1863/*
1864 * Returned from the RPC call DoPut when a CommandStatementUpdate,
1865 * CommandPreparedStatementUpdate, or CommandStatementIngest was
1866 * in the request, containing results from the update.
1867 */
1868message DoPutUpdateResult {
1869 option (experimental) = true;
1870
1871 // The number of records updated. A return value of -1 represents
1872 // an unknown updated record count.
1873 int64 record_count = 1;
1874}
1875
1876/* An *optional* response returned when `DoPut` is called with `CommandPreparedStatementQuery`.
1877 *
1878 * *Note on legacy behavior*: previous versions of the protocol did not return any result for
1879 * this command, and that behavior should still be supported by clients. In that case, the client
1880 * can continue as though the fields in this message were not provided or set to sensible default values.
1881 */
1882message DoPutPreparedStatementResult {
1883 option (experimental) = true;
1884
1885 // Represents a (potentially updated) opaque handle for the prepared statement on the server.
1886 // Because the handle could potentially be updated, any previous handles for this prepared
1887 // statement should be considered invalid, and all subsequent requests for this prepared
1888 // statement must use this new handle.
1889 // The updated handle allows implementing query parameters with stateless services.
1890 //
1891 // When an updated handle is not provided by the server, clients should contiue
1892 // using the previous handle provided by `ActionCreatePreparedStatementResonse`.
1893 optional bytes prepared_statement_handle = 1;
1894}
1895
1896/*
1897 * Request message for the "CancelQuery" action.
1898 *
1899 * Explicitly cancel a running query.
1900 *
1901 * This lets a single client explicitly cancel work, no matter how many clients
1902 * are involved/whether the query is distributed or not, given server support.
1903 * The transaction/statement is not rolled back; it is the application's job to
1904 * commit or rollback as appropriate. This only indicates the client no longer
1905 * wishes to read the remainder of the query results or continue submitting
1906 * data.
1907 *
1908 * This command is idempotent.
1909 *
1910 * This command is deprecated since 13.0.0. Use the "CancelFlightInfo"
1911 * action with DoAction instead.
1912 */
1913message ActionCancelQueryRequest {
1914 option deprecated = true;
1915 option (experimental) = true;
1916
1917 // The result of the GetFlightInfo RPC that initiated the query.
1918 // XXX(ARROW-16902): this must be a serialized FlightInfo, but is
1919 // rendered as bytes because Protobuf does not really support one
1920 // DLL using Protobuf definitions from another DLL.
1921 bytes info = 1;
1922}
1923
1924/*
1925 * The result of cancelling a query.
1926 *
1927 * The result should be wrapped in a google.protobuf.Any message.
1928 *
1929 * This command is deprecated since 13.0.0. Use the "CancelFlightInfo"
1930 * action with DoAction instead.
1931 */
1932message ActionCancelQueryResult {
1933 option deprecated = true;
1934 option (experimental) = true;
1935
1936 enum CancelResult {
1937 // The cancellation status is unknown. Servers should avoid using
1938 // this value (send a NOT_FOUND error if the requested query is
1939 // not known). Clients can retry the request.
1940 CANCEL_RESULT_UNSPECIFIED = 0;
1941 // The cancellation request is complete. Subsequent requests with
1942 // the same payload may return CANCELLED or a NOT_FOUND error.
1943 CANCEL_RESULT_CANCELLED = 1;
1944 // The cancellation request is in progress. The client may retry
1945 // the cancellation request.
1946 CANCEL_RESULT_CANCELLING = 2;
1947 // The query is not cancellable. The client should not retry the
1948 // cancellation request.
1949 CANCEL_RESULT_NOT_CANCELLABLE = 3;
1950 }
1951
1952 CancelResult result = 1;
1953}
1954
1955extend google.protobuf.MessageOptions {
1956 bool experimental = 1000;
1957}