@@ -31,7 +31,7 @@ package arrow.flight.protocol.sql;
3131 *
3232 * The returned schema will be:
3333 * <
34- * info_name: uint32,
34+ * info_name: uint32 not null ,
3535 * value: dense_union<string_value: string, int_value: int32, bigint_value: int64, int32_bitmask: int32>
3636 * >
3737 * where there is one row per requested piece of metadata information.
@@ -156,7 +156,7 @@ enum SqlInfo {
156156 *
157157 * The returned schema will be:
158158 * <
159- * catalog_name: utf8
159+ * catalog_name: utf8 not null
160160 * >
161161 * The returned data should be ordered by catalog_name.
162162 */
@@ -173,16 +173,17 @@ message CommandGetCatalogs {
173173 * The returned schema will be:
174174 * <
175175 * catalog_name: utf8,
176- * schema_name: utf8
176+ * schema_name: utf8 not null
177177 * >
178178 * The returned data should be ordered by catalog_name, then schema_name.
179179 */
180180message CommandGetSchemas {
181181 option (experimental) = true ;
182182
183183 /*
184- * Specifies the Catalog to search for schemas.
185- * If omitted, then all catalogs are searched.
184+ * Specifies the Catalog to search for the tables.
185+ * An empty string retrieves those without a catalog.
186+ * If omitted the catalog name should not be used to narrow the search.
186187 */
187188 google.protobuf.StringValue catalog = 1 ;
188189
@@ -206,18 +207,20 @@ message CommandGetSchemas {
206207 * <
207208 * catalog_name: utf8,
208209 * schema_name: utf8,
209- * table_name: utf8,
210- * table_type: utf8,
211- * table_schema: bytes (schema of the table as described in Schema.fbs::Schema, it is serialized as an IPC message.)
210+ * table_name: utf8 not null,
211+ * table_type: utf8 not null,
212+ * [optional] table_schema: bytes not null (schema of the table as described in Schema.fbs::Schema,
213+ * it is serialized as an IPC message.)
212214 * >
213- * The returned data should be ordered by catalog_name, schema_name, table_name, then table_type.
215+ * The returned data should be ordered by catalog_name, schema_name, table_name, then table_type, followed by table_schema if requested .
214216 */
215217message CommandGetTables {
216218 option (experimental) = true ;
217219
218220 /*
219221 * Specifies the Catalog to search for the tables.
220- * If omitted, then all catalogs are searched.
222+ * An empty string retrieves those without a catalog.
223+ * If omitted the catalog name should not be used to narrow the search.
221224 */
222225 google.protobuf.StringValue catalog = 1 ;
223226
@@ -254,7 +257,7 @@ message CommandGetTables {
254257 *
255258 * The returned schema will be:
256259 * <
257- * table_type: utf8
260+ * table_type: utf8 not null
258261 * >
259262 * The returned data should be ordered by table_type.
260263 */
@@ -282,14 +285,22 @@ message CommandGetTableTypes {
282285message CommandGetPrimaryKeys {
283286 option (experimental) = true ;
284287
285- // Specifies the catalog to search for the table.
288+ /*
289+ * Specifies the catalog to search for the table.
290+ * An empty string retrieves those without a catalog.
291+ * If omitted the catalog name should not be used to narrow the search.
292+ */
286293 google.protobuf.StringValue catalog = 1 ;
287294
288- // Specifies the schema to search for the table.
295+ /*
296+ * Specifies the schema to search for the table.
297+ * An empty string retrieves those without a schema.
298+ * If omitted the schema name should not be used to narrow the search.
299+ */
289300 google.protobuf.StringValue schema = 2 ;
290301
291302 // Specifies the table to get the primary keys for.
292- google.protobuf.StringValue table = 3 ;
303+ string table = 3 ;
293304}
294305
295306/*
@@ -303,28 +314,36 @@ message CommandGetPrimaryKeys {
303314 * <
304315 * pk_catalog_name: utf8,
305316 * pk_schema_name: utf8,
306- * pk_table_name: utf8,
307- * pk_column_name: utf8,
317+ * pk_table_name: utf8 not null ,
318+ * pk_column_name: utf8 not null ,
308319 * fk_catalog_name: utf8,
309320 * fk_schema_name: utf8,
310- * fk_table_name: utf8,
311- * fk_column_name: utf8,
312- * key_sequence: int,
321+ * fk_table_name: utf8 not null ,
322+ * fk_column_name: utf8 not null ,
323+ * key_sequence: int not null ,
313324 * fk_key_name: utf8,
314325 * pk_key_name: utf8,
315- * update_rule: uint1,
316- * delete_rule: uint1
326+ * update_rule: uint1 not null ,
327+ * delete_rule: uint1 not null
317328 * >
318329 * The returned data should be ordered by fk_catalog_name, fk_schema_name, fk_table_name, fk_key_name, then key_sequence.
319330 * update_rule and delete_rule returns a byte that is equivalent to actions declared on UpdateDeleteRules enum.
320331 */
321332message CommandGetExportedKeys {
322333 option (experimental) = true ;
323334
324- // Specifies the catalog to search for the foreign key table.
335+ /*
336+ * Specifies the catalog to search for the foreign key table.
337+ * An empty string retrieves those without a catalog.
338+ * If omitted the catalog name should not be used to narrow the search.
339+ */
325340 google.protobuf.StringValue catalog = 1 ;
326341
327- // Specifies the schema to search for the foreign key table.
342+ /*
343+ * Specifies the schema to search for the foreign key table.
344+ * An empty string retrieves those without a schema.
345+ * If omitted the schema name should not be used to narrow the search.
346+ */
328347 google.protobuf.StringValue schema = 2 ;
329348
330349 // Specifies the foreign key table to get the foreign keys for.
@@ -349,17 +368,17 @@ enum UpdateDeleteRules {
349368 * <
350369 * pk_catalog_name: utf8,
351370 * pk_schema_name: utf8,
352- * pk_table_name: utf8,
353- * pk_column_name: utf8,
371+ * pk_table_name: utf8 not null ,
372+ * pk_column_name: utf8 not null ,
354373 * fk_catalog_name: utf8,
355374 * fk_schema_name: utf8,
356- * fk_table_name: utf8,
357- * fk_column_name: utf8,
358- * key_sequence: int,
375+ * fk_table_name: utf8 not null ,
376+ * fk_column_name: utf8 not null ,
377+ * key_sequence: int not null ,
359378 * fk_key_name: utf8,
360379 * pk_key_name: utf8,
361- * update_rule: uint1,
362- * delete_rule: uint1
380+ * update_rule: uint1 not null ,
381+ * delete_rule: uint1 not null
363382 * >
364383 * The returned data should be ordered by pk_catalog_name, pk_schema_name, pk_table_name, pk_key_name, then key_sequence.
365384 * update_rule and delete_rule returns a byte that is equivalent to actions:
@@ -372,10 +391,18 @@ enum UpdateDeleteRules {
372391message CommandGetImportedKeys {
373392 option (experimental) = true ;
374393
375- // Specifies the catalog to search for the primary key table.
394+ /*
395+ * Specifies the catalog to search for the primary key table.
396+ * An empty string retrieves those without a catalog.
397+ * If omitted the catalog name should not be used to narrow the search.
398+ */
376399 google.protobuf.StringValue catalog = 1 ;
377400
378- // Specifies the schema to search for the primary key table.
401+ /*
402+ * Specifies the schema to search for the primary key table.
403+ * An empty string retrieves those without a schema.
404+ * If omitted the schema name should not be used to narrow the search.
405+ */
379406 google.protobuf.StringValue schema = 2 ;
380407
381408 // Specifies the primary key table to get the foreign keys for.
@@ -391,12 +418,15 @@ message ActionCreatePreparedStatementRequest {
391418 option (experimental) = true ;
392419
393420 // The valid SQL string to create a prepared statement for.
394- // The query should be treated as an opaque value, that is, clients should not attempt to parse this.
395421 string query = 1 ;
396422}
397423
398424/*
399425 * Wrap the result of a "GetPreparedStatement" action.
426+ *
427+ * The resultant PreparedStatement can be closed either:
428+ * - Manually, through the "ClosePreparedStatement" action;
429+ * - Automatically, by a server timeout.
400430 */
401431message ActionCreatePreparedStatementResult {
402432 option (experimental) = true ;
@@ -437,7 +467,6 @@ message CommandStatementQuery {
437467 option (experimental) = true ;
438468
439469 // The SQL syntax.
440- // The query should be treated as an opaque value, that is, clients should not attempt to parse this.
441470 string query = 1 ;
442471}
443472
@@ -473,7 +502,6 @@ message CommandStatementUpdate {
473502 option (experimental) = true ;
474503
475504 // The SQL syntax.
476- // The query should be treated as an opaque value, that is, clients should not attempt to parse this.
477505 string query = 1 ;
478506}
479507
0 commit comments