Skip to content

Commit 311dec3

Browse files
committed
Address code review comments (1)
- Address code review comments from ryannicholson#2
1 parent fb6b822 commit 311dec3

File tree

2 files changed

+245
-142
lines changed

2 files changed

+245
-142
lines changed

format/FlightSQL.proto

Lines changed: 67 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,60 @@ option java_package = "org.apache.arrow.flight.sql.impl";
2222
package arrow.flight.protocol.sql;
2323

2424
/*
25-
* Wrap the result of a "GetSQLInfo" action.
25+
* Wrapper for the result of a "GetSQLInfo" action.
2626
*/
2727
message ActionGetSQLInfoResult {
2828
/*
29-
* Values are based on Apache Hive's Thrift Service and
30-
* ODBC's CLIGetInfo() function. Possible types include:
31-
* - CLI_IDENTIFIER_QUOTE_CHAR
32-
* - CLI_ORDER_BY_COLUMNS_IN_SELECT
33-
* - TODO add more info types.
29+
* Values are modelled after ODBC's SQLGetInfo() function. This information is intended to provide
30+
* Flight SQL clients with basic, SQL syntax and SQL functions related information.
31+
* More information types can be added in future releases.
32+
* E.g. more SQL syntax support types, scalar functions support, type conversion support etc.
33+
*
34+
* Initially, Flight SQL will support the following information types:
35+
* - Server Information
36+
* -
37+
*
38+
* 1. Server Information: Provides basic information about the Flight SQL Server.
39+
*
40+
* The name of the Flight SQL Server.
41+
* FLIGHT_SQL_SERVER_NAME
42+
*
43+
* The native version of the Flight SQL Server.
44+
* FLIGHT_SQL_SERVER_VERSION
45+
*
46+
* The Arrow version of the Flight SQL Server.
47+
* FLIGHT_SQL_SERVER_ARROW_VERSION
48+
*
49+
* Indicates whether the Flight SQL Server is read only.
50+
* FLIGHT_SQL_SERVER_READ_ONLY
51+
*
52+
* Indicates whether the Flight SQL Server supports both read and write.
53+
* FLIGHT_SQL_SERVER_READ_WRITE
54+
*
55+
* 2. SQL Syntax Information: provides information about SQL syntax supported by the Flight SQL Server.
56+
*
57+
* Indicates whether the Flight SQL Server supports CREATE and DROP of catalogs.
58+
* In a SQL environment, a catalog is a collection of schemas.
59+
* SQL_DDL_CATALOG
60+
*
61+
* Indicates whether the Flight SQL Server supports CREATE and DROP of schemas.
62+
* In a SQL environment, a catalog is a collection of tables, views, indexes etc.
63+
* SQL_DDL_SCHEMA
64+
*
65+
* Indicates whether the Flight SQL Server supports CREATE and DROP of tables.
66+
* In a SQL environment, a table is a collection of rows of information. Each row of information
67+
* may have one or more columns of data.
68+
* SQL_DDL_TABLE
69+
*
70+
* Indicates the case sensitivity of catalog, table and schema names.
71+
* SQL_IDENTIFIER_CASE
72+
*
73+
* Indicates the supported character(s) used to surround a delimited identifier.
74+
* SQL_IDENTIFIER_QUOTE_CHAR
75+
*
76+
* Indicates case sensitivity of quoted identifiers.
77+
* SQL_QUOTED_IDENTIFIER_CASE
78+
*
3479
*/
3580
map<string, TGetSQLInfoValue> flight_sql_info = 1;
3681

@@ -41,7 +86,7 @@ message ActionGetSQLInfoResult {
4186
/*
4287
* Wrapper for values returned in ActionGetSQLInfoResult.
4388
*/
44-
message TGetSQLInfoValue {
89+
message GetSQLInfoValue {
4590
oneof value {
4691
string string_value = 1;
4792
int32 integer_value = 2;
@@ -78,17 +123,19 @@ message ActionGetCatalogsResult {
78123
*/
79124
message ActionGetSchemasRequest {
80125
/*
81-
* Specifies the order of result values with prescendence:
126+
* Specifies the order of result values with precedence:
82127
* - catalog
83128
* - schema
84129
*/
85130
ResultsOrder order = 1;
86131

87132
/*
88133
* Specifies the Catalog to search for schemas.
134+
* If omitted, then schemas for all catalogs are searched.
89135
*/
90136
string catalog = 2;
91137

138+
// TODO: Clarify what kind of filter pattern - regex?
92139
// Specifies a filter pattern for schemas to search for.
93140
string schema_filter_pattern = 3;
94141
}
@@ -119,9 +166,11 @@ message ActionGetTablesRequest {
119166
// Specifies the Catalog to search for schemas.
120167
string catalog = 2;
121168

169+
// TODO: Clarify what kind of filter pattern - regex?
122170
// Specifies a filter pattern for schemas to search for.
123171
string schema_filter_pattern = 3;
124172

173+
// TODO: Clarify what kind of filter pattern - regex?
125174
// Specifies a filter pattern for tables to search for.
126175
string table_name_filter_pattern = 4;
127176

@@ -142,8 +191,8 @@ message ActionGetTablesResult {
142191
string table_type = 4;
143192

144193
/*
145-
* Schema of the dataset as described in Schema.fbs::Schema,
146-
* Null if includeSchema on request is false.
194+
* Schema of the dataset as described in Schema.fbs::Schema, it is serialized as an IPC message.
195+
* Null if include_schema on request is false.
147196
*/
148197
bytes arrow_metadata = 5;
149198
}
@@ -152,18 +201,20 @@ message ActionGetTablesResult {
152201
* Wrap the result of a "GetTableTypes" action.
153202
*/
154203
message ActionGetTableTypesResult {
204+
/*
205+
* Indicates the type of the table. E.g. table (regular data table) , view, system table etc.
206+
*/
155207
string table_type = 1;
156208
}
157209

158210
// SQL Execution Action Messages
159211

160212
/*
161213
* Request message for the "GetPreparedStatement" action on a
162-
* Flight SQL enabled backend.
163-
* Requests a list of tables available in the server.
214+
* Flight SQL enabled backend.
164215
*/
165216
message ActionGetPreparedStatementRequest {
166-
// The SQL syntax.
217+
// The valid SQL string to get a prepared statement for.
167218
string query = 1;
168219
}
169220

@@ -176,7 +227,7 @@ message ActionGetPreparedStatementResult {
176227
bytes prepared_statement_handle = 1;
177228

178229
// If a result set generating query was provided, dataset_schema contains the
179-
// schema of the dataset as described in Schema.fbs::Schema.
230+
// schema of the dataset as described in Schema.fbs::Schema, it is serialized as an IPC message.
180231
bytes dataset_schema = 2;
181232

182233
// If the query provided contained parameters, parameter_schema contains the
@@ -211,6 +262,8 @@ message CommandStatementQuery {
211262
/*
212263
* Represents an instance of executing a prepared statement. Used in the
213264
* command member of FlightDescriptor for the following RPC calls:
265+
* TODO: Is the idea that a Put with parameter values would execute multiple bound versions of the prepared statement
266+
* TODO: (one for each row)? Seems like that will work ok for Insert statements, but what about other kinds of prepared statements?
214267
* - DoPut: bind parameter values.
215268
* - GetFlightInfo: execute the prepared statement instance.
216269
*/

0 commit comments

Comments
 (0)