lidavidm commented on a change in pull request #11982: URL: https://github.com/apache/arrow/pull/11982#discussion_r784295635
########## File path: cpp/src/arrow/flight/sql/example/sqlite_type_info.h ########## @@ -0,0 +1,39 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + +#pragma once + +#include "arrow/record_batch.h" + +namespace arrow { +namespace flight { +namespace sql { +namespace example { + +/// \brief Gets the harded-coded type info from Sqlite for all data types. +/// \return A record batch. +std::shared_ptr<RecordBatch> DoGetTypeInfoResult(const std::shared_ptr<Schema>& schema); Review comment: Actually, wait - why does this take the schema? The schema should be fixed, no? ########## File path: cpp/src/arrow/flight/sql/server_test.cc ########## @@ -381,6 +382,43 @@ TEST_F(TestFlightSqlServer, TestCommandGetTablesWithIncludedSchemas) { AssertTablesEqual(*expected_table, *table); } +TEST_F(TestFlightSqlServer, TestCommandGetTypeInfo) { + ASSERT_OK_AND_ASSIGN(auto flight_info, sql_client->GetTypeInfo({})); + + ASSERT_OK_AND_ASSIGN(auto stream, + sql_client->DoGet({}, flight_info->endpoints()[0].ticket)); + + auto expected_schema = SqlSchema::GetTypeInfoSchema(); + + const std::shared_ptr<RecordBatch>& batch = Review comment: nit, but this isn't a reference either - it should just be `const std::shared_ptr<RecordBatch> batch` or `const auto batch` ########## File path: format/FlightSql.proto ########## @@ -867,6 +867,69 @@ enum SqlSupportsConvert { SQL_CONVERT_VARCHAR = 19; } +/* + * Represents a request to retrieve information about data type supported ona Flight SQL enabled backend. + * Used in the command member of FlightDescriptor for the following RPC calls: + * - GetSchema: return the schema of the query. + * - GetFlightInfo: execute the catalog metadata request. + * + * The returned schema will be: + * < + * type_name: utf8 not null (The name of the data type, for example: VARCHAR, INTEGER, etc), + * data_type: int not null (The SQL data type), + * column_size: int (The maximum column size that the server supports for this data type. + * For numeric data, this is the maximum precision. + * For string data, this is the length in characters. + * For datetime data types, this is the length in characters of the string representation. + * NULL is returned for data types where column size is not applicable.), + * literal_prefix: utf8 (Character or characters used to prefix a literal, NULL is returned for + * data types where a literal prefix is not applicable.), + * literal_suffix: utf8 (Character or characters used to terminate a literal, + * NULL is returned for data types where a literal suffix is not applicable.), + * create_params: utf8 (A list of keywords, separated by commas, corresponding + * to each parameter that the application may specify in parentheses + * when using the name that is returned in the TYPE_NAME field. + * NULL is returned if there are no parameters for the data type definition.), + * nullable: int not null (Shows if the data type accepts a NULL value), + * case_sensitive: bool not null (Shows if a character data type is case-sensitive in collations and comparisons), + * searchable: int not null (Shows how the data type is used in a WHERE clause), + * unsigned_attribute: bool (Shows if the data type is unsigned. NULL is returned if the attribute is + * not applicable to the data type or the data type is not numeric.), + * fixed_prec_scale: bool not null (Shows if the data type has predefined fixed precision and scale.), + * auto_increment: bool (Shows if the data type is auto incremental. NULL is returned if the attribute + * is not applicable to the data type or the data type is not numeric.), + * local_type_name: utf8 (Localized version of the data source-dependent name of the data type. NULL + * is returned if a localized name is not supported by the data source), + * minimum_scale: int (The minimum scale of the data type on the data source. + * If a data type has a fixed scale, the MINIMUM_SCALE and MAXIMUM_SCALE + * columns both contain this value. NULL is returned if scale is not applicable.), + * maximum_scale: int (The maximum scale of the data type on the data source. + * NULL is returned if scale is not applicable.), + * sql_data_type: int not null (The value of the SQL data type as it appears in the Review comment: It seems data_type is a code that fully identifies the data type (e.g. interval of month) while this identifies a generic type (e.g. interval)? ########## File path: format/FlightSql.proto ########## @@ -867,6 +867,69 @@ enum SqlSupportsConvert { SQL_CONVERT_VARCHAR = 19; } +/* + * Represents a request to retrieve information about data type supported ona Flight SQL enabled backend. + * Used in the command member of FlightDescriptor for the following RPC calls: + * - GetSchema: return the schema of the query. + * - GetFlightInfo: execute the catalog metadata request. + * + * The returned schema will be: + * < + * type_name: utf8 not null (The name of the data type, for example: VARCHAR, INTEGER, etc), + * data_type: int not null (The SQL data type), + * column_size: int (The maximum column size that the server supports for this data type. + * For numeric data, this is the maximum precision. + * For string data, this is the length in characters. + * For datetime data types, this is the length in characters of the string representation. + * NULL is returned for data types where column size is not applicable.), + * literal_prefix: utf8 (Character or characters used to prefix a literal, NULL is returned for + * data types where a literal prefix is not applicable.), + * literal_suffix: utf8 (Character or characters used to terminate a literal, + * NULL is returned for data types where a literal suffix is not applicable.), + * create_params: utf8 (A list of keywords, separated by commas, corresponding + * to each parameter that the application may specify in parentheses + * when using the name that is returned in the TYPE_NAME field. + * NULL is returned if there are no parameters for the data type definition.), + * nullable: int not null (Shows if the data type accepts a NULL value), + * case_sensitive: bool not null (Shows if a character data type is case-sensitive in collations and comparisons), + * searchable: int not null (Shows how the data type is used in a WHERE clause), + * unsigned_attribute: bool (Shows if the data type is unsigned. NULL is returned if the attribute is + * not applicable to the data type or the data type is not numeric.), + * fixed_prec_scale: bool not null (Shows if the data type has predefined fixed precision and scale.), + * auto_increment: bool (Shows if the data type is auto incremental. NULL is returned if the attribute + * is not applicable to the data type or the data type is not numeric.), + * local_type_name: utf8 (Localized version of the data source-dependent name of the data type. NULL + * is returned if a localized name is not supported by the data source), + * minimum_scale: int (The minimum scale of the data type on the data source. + * If a data type has a fixed scale, the MINIMUM_SCALE and MAXIMUM_SCALE + * columns both contain this value. NULL is returned if scale is not applicable.), + * maximum_scale: int (The maximum scale of the data type on the data source. + * NULL is returned if scale is not applicable.), + * sql_data_type: int not null (The value of the SQL data type as it appears in the + * SQL_DESC_TYPE field of the descriptor. This column is + * the same as the DATA_TYPE column, except for interval and + * datetime data types.), + * sql_datetime_sub: int (When the value of SQL_DATA_TYPE is SQL_DATETIME or SQL_INTERVAL, + * this column contains the datetime/interval subcode. For data types Review comment: Could it be written out as `datetime_subcode` or something? (The `sql_` prefix on these field names seems generally redundant.) ########## File path: format/FlightSql.proto ########## @@ -867,6 +867,69 @@ enum SqlSupportsConvert { SQL_CONVERT_VARCHAR = 19; } +/* + * Represents a request to retrieve information about data type supported ona Flight SQL enabled backend. + * Used in the command member of FlightDescriptor for the following RPC calls: + * - GetSchema: return the schema of the query. + * - GetFlightInfo: execute the catalog metadata request. + * + * The returned schema will be: + * < + * type_name: utf8 not null (The name of the data type, for example: VARCHAR, INTEGER, etc), + * data_type: int not null (The SQL data type), + * column_size: int (The maximum column size that the server supports for this data type. + * For numeric data, this is the maximum precision. + * For string data, this is the length in characters. + * For datetime data types, this is the length in characters of the string representation. + * NULL is returned for data types where column size is not applicable.), + * literal_prefix: utf8 (Character or characters used to prefix a literal, NULL is returned for + * data types where a literal prefix is not applicable.), + * literal_suffix: utf8 (Character or characters used to terminate a literal, + * NULL is returned for data types where a literal suffix is not applicable.), + * create_params: utf8 (A list of keywords, separated by commas, corresponding + * to each parameter that the application may specify in parentheses + * when using the name that is returned in the TYPE_NAME field. + * NULL is returned if there are no parameters for the data type definition.), + * nullable: int not null (Shows if the data type accepts a NULL value), Review comment: I think I might have asked this before but why is this not a bool? ########## File path: format/FlightSql.proto ########## @@ -867,6 +867,69 @@ enum SqlSupportsConvert { SQL_CONVERT_VARCHAR = 19; } +/* + * Represents a request to retrieve information about data type supported ona Flight SQL enabled backend. + * Used in the command member of FlightDescriptor for the following RPC calls: + * - GetSchema: return the schema of the query. + * - GetFlightInfo: execute the catalog metadata request. + * + * The returned schema will be: + * < + * type_name: utf8 not null (The name of the data type, for example: VARCHAR, INTEGER, etc), + * data_type: int not null (The SQL data type), + * column_size: int (The maximum column size that the server supports for this data type. + * For numeric data, this is the maximum precision. + * For string data, this is the length in characters. + * For datetime data types, this is the length in characters of the string representation. + * NULL is returned for data types where column size is not applicable.), + * literal_prefix: utf8 (Character or characters used to prefix a literal, NULL is returned for + * data types where a literal prefix is not applicable.), + * literal_suffix: utf8 (Character or characters used to terminate a literal, + * NULL is returned for data types where a literal suffix is not applicable.), + * create_params: utf8 (A list of keywords, separated by commas, corresponding Review comment: Would this make more sense as List[String not null]? ########## File path: cpp/src/arrow/flight/sql/server_test.cc ########## @@ -381,6 +382,43 @@ TEST_F(TestFlightSqlServer, TestCommandGetTablesWithIncludedSchemas) { AssertTablesEqual(*expected_table, *table); } +TEST_F(TestFlightSqlServer, TestCommandGetTypeInfo) { + ASSERT_OK_AND_ASSIGN(auto flight_info, sql_client->GetTypeInfo({})); + + ASSERT_OK_AND_ASSIGN(auto stream, + sql_client->DoGet({}, flight_info->endpoints()[0].ticket)); + + auto expected_schema = SqlSchema::GetTypeInfoSchema(); + + const std::shared_ptr<RecordBatch>& batch = Review comment: (And the same goes below) ########## File path: format/FlightSql.proto ########## @@ -867,6 +867,69 @@ enum SqlSupportsConvert { SQL_CONVERT_VARCHAR = 19; } +/* + * Represents a request to retrieve information about data type supported ona Flight SQL enabled backend. + * Used in the command member of FlightDescriptor for the following RPC calls: + * - GetSchema: return the schema of the query. + * - GetFlightInfo: execute the catalog metadata request. + * + * The returned schema will be: + * < + * type_name: utf8 not null (The name of the data type, for example: VARCHAR, INTEGER, etc), + * data_type: int not null (The SQL data type), Review comment: To clarify, this is a database-specific type code uniquely identifying a data type (the "concise type" in ODBC terms)? ########## File path: format/FlightSql.proto ########## @@ -867,6 +867,69 @@ enum SqlSupportsConvert { SQL_CONVERT_VARCHAR = 19; } +/* + * Represents a request to retrieve information about data type supported ona Flight SQL enabled backend. Review comment: ```suggestion * Represents a request to retrieve information about data type supported on a Flight SQL enabled backend. ``` ########## File path: format/FlightSql.proto ########## @@ -867,6 +867,69 @@ enum SqlSupportsConvert { SQL_CONVERT_VARCHAR = 19; } +/* + * Represents a request to retrieve information about data type supported ona Flight SQL enabled backend. + * Used in the command member of FlightDescriptor for the following RPC calls: + * - GetSchema: return the schema of the query. + * - GetFlightInfo: execute the catalog metadata request. + * + * The returned schema will be: + * < + * type_name: utf8 not null (The name of the data type, for example: VARCHAR, INTEGER, etc), + * data_type: int not null (The SQL data type), + * column_size: int (The maximum column size that the server supports for this data type. + * For numeric data, this is the maximum precision. + * For string data, this is the length in characters. + * For datetime data types, this is the length in characters of the string representation. + * NULL is returned for data types where column size is not applicable.), + * literal_prefix: utf8 (Character or characters used to prefix a literal, NULL is returned for + * data types where a literal prefix is not applicable.), + * literal_suffix: utf8 (Character or characters used to terminate a literal, + * NULL is returned for data types where a literal suffix is not applicable.), + * create_params: utf8 (A list of keywords, separated by commas, corresponding + * to each parameter that the application may specify in parentheses + * when using the name that is returned in the TYPE_NAME field. + * NULL is returned if there are no parameters for the data type definition.), + * nullable: int not null (Shows if the data type accepts a NULL value), + * case_sensitive: bool not null (Shows if a character data type is case-sensitive in collations and comparisons), + * searchable: int not null (Shows how the data type is used in a WHERE clause), + * unsigned_attribute: bool (Shows if the data type is unsigned. NULL is returned if the attribute is + * not applicable to the data type or the data type is not numeric.), + * fixed_prec_scale: bool not null (Shows if the data type has predefined fixed precision and scale.), + * auto_increment: bool (Shows if the data type is auto incremental. NULL is returned if the attribute + * is not applicable to the data type or the data type is not numeric.), + * local_type_name: utf8 (Localized version of the data source-dependent name of the data type. NULL + * is returned if a localized name is not supported by the data source), + * minimum_scale: int (The minimum scale of the data type on the data source. + * If a data type has a fixed scale, the MINIMUM_SCALE and MAXIMUM_SCALE + * columns both contain this value. NULL is returned if scale is not applicable.), + * maximum_scale: int (The maximum scale of the data type on the data source. + * NULL is returned if scale is not applicable.), + * sql_data_type: int not null (The value of the SQL data type as it appears in the + * SQL_DESC_TYPE field of the descriptor. This column is + * the same as the DATA_TYPE column, except for interval and + * datetime data types.), + * sql_datetime_sub: int (When the value of SQL_DATA_TYPE is SQL_DATETIME or SQL_INTERVAL, + * this column contains the datetime/interval subcode. For data types Review comment: What is the subcode? ########## File path: format/FlightSql.proto ########## @@ -867,6 +867,69 @@ enum SqlSupportsConvert { SQL_CONVERT_VARCHAR = 19; } +/* + * Represents a request to retrieve information about data type supported ona Flight SQL enabled backend. + * Used in the command member of FlightDescriptor for the following RPC calls: + * - GetSchema: return the schema of the query. + * - GetFlightInfo: execute the catalog metadata request. + * + * The returned schema will be: + * < + * type_name: utf8 not null (The name of the data type, for example: VARCHAR, INTEGER, etc), + * data_type: int not null (The SQL data type), + * column_size: int (The maximum column size that the server supports for this data type. + * For numeric data, this is the maximum precision. + * For string data, this is the length in characters. + * For datetime data types, this is the length in characters of the string representation. + * NULL is returned for data types where column size is not applicable.), + * literal_prefix: utf8 (Character or characters used to prefix a literal, NULL is returned for + * data types where a literal prefix is not applicable.), + * literal_suffix: utf8 (Character or characters used to terminate a literal, + * NULL is returned for data types where a literal suffix is not applicable.), + * create_params: utf8 (A list of keywords, separated by commas, corresponding + * to each parameter that the application may specify in parentheses + * when using the name that is returned in the TYPE_NAME field. + * NULL is returned if there are no parameters for the data type definition.), + * nullable: int not null (Shows if the data type accepts a NULL value), + * case_sensitive: bool not null (Shows if a character data type is case-sensitive in collations and comparisons), + * searchable: int not null (Shows how the data type is used in a WHERE clause), + * unsigned_attribute: bool (Shows if the data type is unsigned. NULL is returned if the attribute is + * not applicable to the data type or the data type is not numeric.), + * fixed_prec_scale: bool not null (Shows if the data type has predefined fixed precision and scale.), + * auto_increment: bool (Shows if the data type is auto incremental. NULL is returned if the attribute + * is not applicable to the data type or the data type is not numeric.), + * local_type_name: utf8 (Localized version of the data source-dependent name of the data type. NULL + * is returned if a localized name is not supported by the data source), + * minimum_scale: int (The minimum scale of the data type on the data source. + * If a data type has a fixed scale, the MINIMUM_SCALE and MAXIMUM_SCALE + * columns both contain this value. NULL is returned if scale is not applicable.), + * maximum_scale: int (The maximum scale of the data type on the data source. + * NULL is returned if scale is not applicable.), + * sql_data_type: int not null (The value of the SQL data type as it appears in the Review comment: The ODBC docs use "verbose" and "concise" terminology, maybe this should be renamed `verbose_data_type`? ########## File path: format/FlightSql.proto ########## @@ -867,6 +867,69 @@ enum SqlSupportsConvert { SQL_CONVERT_VARCHAR = 19; } +/* + * Represents a request to retrieve information about data type supported ona Flight SQL enabled backend. + * Used in the command member of FlightDescriptor for the following RPC calls: + * - GetSchema: return the schema of the query. + * - GetFlightInfo: execute the catalog metadata request. + * + * The returned schema will be: + * < + * type_name: utf8 not null (The name of the data type, for example: VARCHAR, INTEGER, etc), + * data_type: int not null (The SQL data type), + * column_size: int (The maximum column size that the server supports for this data type. + * For numeric data, this is the maximum precision. + * For string data, this is the length in characters. + * For datetime data types, this is the length in characters of the string representation. + * NULL is returned for data types where column size is not applicable.), + * literal_prefix: utf8 (Character or characters used to prefix a literal, NULL is returned for + * data types where a literal prefix is not applicable.), + * literal_suffix: utf8 (Character or characters used to terminate a literal, + * NULL is returned for data types where a literal suffix is not applicable.), + * create_params: utf8 (A list of keywords, separated by commas, corresponding + * to each parameter that the application may specify in parentheses + * when using the name that is returned in the TYPE_NAME field. + * NULL is returned if there are no parameters for the data type definition.), + * nullable: int not null (Shows if the data type accepts a NULL value), + * case_sensitive: bool not null (Shows if a character data type is case-sensitive in collations and comparisons), + * searchable: int not null (Shows how the data type is used in a WHERE clause), + * unsigned_attribute: bool (Shows if the data type is unsigned. NULL is returned if the attribute is + * not applicable to the data type or the data type is not numeric.), + * fixed_prec_scale: bool not null (Shows if the data type has predefined fixed precision and scale.), + * auto_increment: bool (Shows if the data type is auto incremental. NULL is returned if the attribute + * is not applicable to the data type or the data type is not numeric.), + * local_type_name: utf8 (Localized version of the data source-dependent name of the data type. NULL + * is returned if a localized name is not supported by the data source), + * minimum_scale: int (The minimum scale of the data type on the data source. + * If a data type has a fixed scale, the MINIMUM_SCALE and MAXIMUM_SCALE + * columns both contain this value. NULL is returned if scale is not applicable.), + * maximum_scale: int (The maximum scale of the data type on the data source. + * NULL is returned if scale is not applicable.), + * sql_data_type: int not null (The value of the SQL data type as it appears in the Review comment: This seems to be taken from ODBC, can we clarify what exactly it means? It's not clear how it differs ########## File path: format/FlightSql.proto ########## @@ -867,6 +867,69 @@ enum SqlSupportsConvert { SQL_CONVERT_VARCHAR = 19; } +/* + * Represents a request to retrieve information about data type supported ona Flight SQL enabled backend. + * Used in the command member of FlightDescriptor for the following RPC calls: + * - GetSchema: return the schema of the query. + * - GetFlightInfo: execute the catalog metadata request. + * + * The returned schema will be: + * < + * type_name: utf8 not null (The name of the data type, for example: VARCHAR, INTEGER, etc), + * data_type: int not null (The SQL data type), + * column_size: int (The maximum column size that the server supports for this data type. + * For numeric data, this is the maximum precision. + * For string data, this is the length in characters. + * For datetime data types, this is the length in characters of the string representation. + * NULL is returned for data types where column size is not applicable.), + * literal_prefix: utf8 (Character or characters used to prefix a literal, NULL is returned for + * data types where a literal prefix is not applicable.), + * literal_suffix: utf8 (Character or characters used to terminate a literal, + * NULL is returned for data types where a literal suffix is not applicable.), + * create_params: utf8 (A list of keywords, separated by commas, corresponding + * to each parameter that the application may specify in parentheses + * when using the name that is returned in the TYPE_NAME field. + * NULL is returned if there are no parameters for the data type definition.), + * nullable: int not null (Shows if the data type accepts a NULL value), Review comment: (And ditto for `searchable` below) ########## File path: format/FlightSql.proto ########## @@ -867,6 +867,69 @@ enum SqlSupportsConvert { SQL_CONVERT_VARCHAR = 19; } +/* + * Represents a request to retrieve information about data type supported ona Flight SQL enabled backend. + * Used in the command member of FlightDescriptor for the following RPC calls: + * - GetSchema: return the schema of the query. + * - GetFlightInfo: execute the catalog metadata request. + * + * The returned schema will be: + * < + * type_name: utf8 not null (The name of the data type, for example: VARCHAR, INTEGER, etc), + * data_type: int not null (The SQL data type), + * column_size: int (The maximum column size that the server supports for this data type. + * For numeric data, this is the maximum precision. + * For string data, this is the length in characters. + * For datetime data types, this is the length in characters of the string representation. + * NULL is returned for data types where column size is not applicable.), + * literal_prefix: utf8 (Character or characters used to prefix a literal, NULL is returned for + * data types where a literal prefix is not applicable.), + * literal_suffix: utf8 (Character or characters used to terminate a literal, + * NULL is returned for data types where a literal suffix is not applicable.), + * create_params: utf8 (A list of keywords, separated by commas, corresponding + * to each parameter that the application may specify in parentheses + * when using the name that is returned in the TYPE_NAME field. + * NULL is returned if there are no parameters for the data type definition.), + * nullable: int not null (Shows if the data type accepts a NULL value), + * case_sensitive: bool not null (Shows if a character data type is case-sensitive in collations and comparisons), + * searchable: int not null (Shows how the data type is used in a WHERE clause), + * unsigned_attribute: bool (Shows if the data type is unsigned. NULL is returned if the attribute is + * not applicable to the data type or the data type is not numeric.), + * fixed_prec_scale: bool not null (Shows if the data type has predefined fixed precision and scale.), + * auto_increment: bool (Shows if the data type is auto incremental. NULL is returned if the attribute + * is not applicable to the data type or the data type is not numeric.), + * local_type_name: utf8 (Localized version of the data source-dependent name of the data type. NULL + * is returned if a localized name is not supported by the data source), + * minimum_scale: int (The minimum scale of the data type on the data source. + * If a data type has a fixed scale, the MINIMUM_SCALE and MAXIMUM_SCALE + * columns both contain this value. NULL is returned if scale is not applicable.), + * maximum_scale: int (The maximum scale of the data type on the data source. + * NULL is returned if scale is not applicable.), + * sql_data_type: int not null (The value of the SQL data type as it appears in the + * SQL_DESC_TYPE field of the descriptor. This column is + * the same as the DATA_TYPE column, except for interval and + * datetime data types.), + * sql_datetime_sub: int (When the value of SQL_DATA_TYPE is SQL_DATETIME or SQL_INTERVAL, + * this column contains the datetime/interval subcode. For data types Review comment: Ah, it appears to pair with sql_data_type above. ########## File path: format/FlightSql.proto ########## @@ -867,6 +867,69 @@ enum SqlSupportsConvert { SQL_CONVERT_VARCHAR = 19; } +/* + * Represents a request to retrieve information about data type supported ona Flight SQL enabled backend. + * Used in the command member of FlightDescriptor for the following RPC calls: + * - GetSchema: return the schema of the query. + * - GetFlightInfo: execute the catalog metadata request. + * + * The returned schema will be: + * < + * type_name: utf8 not null (The name of the data type, for example: VARCHAR, INTEGER, etc), + * data_type: int not null (The SQL data type), + * column_size: int (The maximum column size that the server supports for this data type. + * For numeric data, this is the maximum precision. + * For string data, this is the length in characters. + * For datetime data types, this is the length in characters of the string representation. + * NULL is returned for data types where column size is not applicable.), + * literal_prefix: utf8 (Character or characters used to prefix a literal, NULL is returned for + * data types where a literal prefix is not applicable.), + * literal_suffix: utf8 (Character or characters used to terminate a literal, + * NULL is returned for data types where a literal suffix is not applicable.), + * create_params: utf8 (A list of keywords, separated by commas, corresponding + * to each parameter that the application may specify in parentheses + * when using the name that is returned in the TYPE_NAME field. + * NULL is returned if there are no parameters for the data type definition.), + * nullable: int not null (Shows if the data type accepts a NULL value), + * case_sensitive: bool not null (Shows if a character data type is case-sensitive in collations and comparisons), + * searchable: int not null (Shows how the data type is used in a WHERE clause), + * unsigned_attribute: bool (Shows if the data type is unsigned. NULL is returned if the attribute is + * not applicable to the data type or the data type is not numeric.), + * fixed_prec_scale: bool not null (Shows if the data type has predefined fixed precision and scale.), + * auto_increment: bool (Shows if the data type is auto incremental. NULL is returned if the attribute + * is not applicable to the data type or the data type is not numeric.), + * local_type_name: utf8 (Localized version of the data source-dependent name of the data type. NULL + * is returned if a localized name is not supported by the data source), + * minimum_scale: int (The minimum scale of the data type on the data source. + * If a data type has a fixed scale, the MINIMUM_SCALE and MAXIMUM_SCALE + * columns both contain this value. NULL is returned if scale is not applicable.), + * maximum_scale: int (The maximum scale of the data type on the data source. + * NULL is returned if scale is not applicable.), + * sql_data_type: int not null (The value of the SQL data type as it appears in the + * SQL_DESC_TYPE field of the descriptor. This column is + * the same as the DATA_TYPE column, except for interval and + * datetime data types.), + * sql_datetime_sub: int (When the value of SQL_DATA_TYPE is SQL_DATETIME or SQL_INTERVAL, + * this column contains the datetime/interval subcode. For data types Review comment: It seems ODBC has defined values for this, can we have an enum for them? ########## File path: format/FlightSql.proto ########## @@ -867,6 +867,69 @@ enum SqlSupportsConvert { SQL_CONVERT_VARCHAR = 19; } +/* + * Represents a request to retrieve information about data type supported ona Flight SQL enabled backend. + * Used in the command member of FlightDescriptor for the following RPC calls: + * - GetSchema: return the schema of the query. + * - GetFlightInfo: execute the catalog metadata request. + * + * The returned schema will be: + * < + * type_name: utf8 not null (The name of the data type, for example: VARCHAR, INTEGER, etc), + * data_type: int not null (The SQL data type), Review comment: Or is this actually database-specific? It seems ODBC has defined values for this. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org