pitrou commented on a change in pull request #11982:
URL: https://github.com/apache/arrow/pull/11982#discussion_r803778731



##########
File path: format/FlightSql.proto
##########
@@ -867,6 +867,167 @@ enum SqlSupportsConvert {
   SQL_CONVERT_VARCHAR = 19;
 }
 
+enum SqlDataType {
+  SQL_TYPE_UNKNOWN_TYPE = 0;
+  SQL_TYPE_CHAR = 1;
+  SQL_TYPE_NUMERIC = 2;
+  SQL_TYPE_DECIMAL = 3;
+  SQL_TYPE_INTEGER = 4;
+  SQL_TYPE_SMALLINT = 5;
+  SQL_TYPE_FLOAT = 6;
+  SQL_TYPE_REAL = 7;
+  SQL_TYPE_DOUBLE = 8;
+  SQL_TYPE_DATETIME = 9;
+  SQL_TYPE_INTERVAL = 10;
+  SQL_TYPE_VARCHAR = 12;
+}
+
+enum SqlDatetimeSubcode {
+  option allow_alias = true;
+  SQL_SUBCODE_UNKNOWN = 0;
+  SQL_SUBCODE_YEAR = 1;
+  SQL_SUBCODE_DATE = 1;
+  SQL_SUBCODE_TIME = 2;
+  SQL_SUBCODE_MONTH = 2;
+  SQL_SUBCODE_TIMESTAMP = 3;
+  SQL_SUBCODE_DAY = 3;
+  SQL_SUBCODE_TIME_WITH_TIMEZONE = 4;
+  SQL_SUBCODE_HOUR = 4;
+  SQL_SUBCODE_TIMESTAMP_WITH_TIMEZONE = 5;
+  SQL_SUBCODE_MINUTE = 5;
+  SQL_SUBCODE_SECOND = 6;
+  SQL_SUBCODE_YEAR_TO_MONTH = 7;
+  SQL_SUBCODE_DAY_TO_HOUR = 8;
+  SQL_SUBCODE_DAY_TO_MINUTE = 9;
+  SQL_SUBCODE_DAY_TO_SECOND = 10;
+  SQL_SUBCODE_HOUR_TO_MINUTE = 11;
+  SQL_SUBCODE_HOUR_TO_SECOND = 12;
+  SQL_SUBCODE_MINUTE_TO_SECOND = 13;
+  SQL_SUBCODE_INTERVAL_YEAR = 101;
+  SQL_SUBCODE_INTERVAL_MONTH = 102;
+  SQL_SUBCODE_INTERVAL_DAY = 103;
+  SQL_SUBCODE_INTERVAL_HOUR = 104;
+  SQL_SUBCODE_INTERVAL_MINUTE = 105;
+  SQL_SUBCODE_INTERVAL_SECOND = 106;
+  SQL_SUBCODE_INTERVAL_YEAR_TO_MONTH = 107;
+  SQL_SUBCODE_INTERVAL_DAY_TO_HOUR = 108;
+  SQL_SUBCODE_INTERVAL_DAY_TO_MINUTE = 109;
+  SQL_SUBCODE_INTERVAL_DAY_TO_SECOND = 110;
+  SQL_SUBCODE_INTERVAL_HOUR_TO_MINUTE = 111;
+  SQL_SUBCODE_INTERVAL_HOUR_TO_SECOND = 112;
+  SQL_SUBCODE_INTERVAL_MINUTE_TO_SECOND = 113;
+}
+
+enum Nullable {
+  /**
+   * Indicates that the fields does not allow the use of null values.
+   */
+  NULLABILITY_NO_NULLS = 0;
+
+  /**
+   * Indicates that the fields allow the use of null values.
+   */
+  NULLABILITY_NULLABLE = 1;
+
+  /**
+   * Indicates that nullability of the fields can not be determined.
+   */
+  NULLABILITY_UNKNOWN = 2;
+}
+
+enum Searchable {
+  /**
+   * Indicates that column can not be used in a WHERE clause.
+   */
+  SEARCHABLE_NONE = 0;
+
+  /**
+   * Indicates that the column can be used in a WHERE clause if it is using a
+   * LIKE predicate.
+   */
+  SEARCHABLE_CHAR = 1;
+
+  /**
+   * Indicates that the column can be used in a WHERE clause using other 
predicates
+   * except for LIKE.
+   *
+   * - Allowed operators: comparison, quantified comparison, BETWEEN,
+   *                      DISTINCT, IN, MATCH, and UNIQUE.
+   */
+  SEARCHABLE_BASIC = 2;
+
+  /**
+   * Indicates that the column can be used in a WHERE clause using any 
operator.
+   */
+  SEARCHABLE_FULL = 3;
+}
+
+/*
+ * Represents a request to retrieve information about data type supported on a 
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 size supported by that column.
+ *                     In case of numeric types, this represents the maximum 
precision.
+ *                     In case of string types, this represents the character 
length.
+ *                     In case of datetime data types, this represents 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.),

Review comment:
       "Character or characters used to prefix a literal" applies to which 
context? It seems this is talking about a text representation of the query? 
Otherwise, why would you prefix a literal?




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to