You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/03/21 18:02:16 UTC

[GitHub] [arrow] pitrou commented on a change in pull request #11982: ARROW-15313: [C++][Java][FlightRPC] Implement type info method to flight-sql

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



##########
File path: format/FlightSql.proto
##########
@@ -867,6 +867,189 @@ enum SqlSupportsConvert {
   SQL_CONVERT_VARCHAR = 19;
 }
 
+/**
+ * It is an attribute that identifies the type of any object. It's
+ * used by JDBC and ODBC to expose the values defined by the DBMS.
+ * All the values here are the sames as in the JDBC and ODBC specs.
+ */
+enum XdbcDataType {
+  XDBC_UNKNOWN_TYPE = 0;
+  XDBC_CHAR = 1;
+  XDBC_NUMERIC = 2;
+  XDBC_DECIMAL = 3;
+  XDBC_INTEGER = 4;
+  XDBC_SMALLINT = 5;
+  XDBC_FLOAT = 6;
+  XDBC_REAL = 7;
+  XDBC_DOUBLE = 8;
+  XDBC_DATETIME = 9;
+  XDBC_INTERVAL = 10;
+  XDBC_VARCHAR = 12;
+  XDBC_DATE = 91;
+  XDBC_TIME = 92;
+  XDBC_TIMESTAMP = 93;
+  XDBC_LONGVARCHAR = -1;
+  XDBC_BINARY = -2;
+  XDBC_VARBINARY = -3;
+  XDBC_LONGVARBINARY = -4;
+  XDBC_BIGINT = -5;
+  XDBC_TINYINT = -6;
+  XDBC_BIT = -7;
+  XDBC_WCHAR = -8;
+  XDBC_WVARCHAR = -9;
+}
+
+/**
+ * When the values returned by the XdbcDataType is XDBC_TYPE_DATETIME or XDBC_TYPE_INTERVAL,
+ * more information about this column can be obtain through the values in this enum.
+ */
+enum XdbcDatetimeSubcode {
+  option allow_alias = true;
+  XDBC_SUBCODE_UNKNOWN = 0;
+  XDBC_SUBCODE_YEAR = 1;
+  XDBC_SUBCODE_DATE = 1;
+  XDBC_SUBCODE_TIME = 2;
+  XDBC_SUBCODE_MONTH = 2;
+  XDBC_SUBCODE_TIMESTAMP = 3;
+  XDBC_SUBCODE_DAY = 3;
+  XDBC_SUBCODE_TIME_WITH_TIMEZONE = 4;
+  XDBC_SUBCODE_HOUR = 4;
+  XDBC_SUBCODE_TIMESTAMP_WITH_TIMEZONE = 5;
+  XDBC_SUBCODE_MINUTE = 5;
+  XDBC_SUBCODE_SECOND = 6;
+  XDBC_SUBCODE_YEAR_TO_MONTH = 7;
+  XDBC_SUBCODE_DAY_TO_HOUR = 8;
+  XDBC_SUBCODE_DAY_TO_MINUTE = 9;
+  XDBC_SUBCODE_DAY_TO_SECOND = 10;
+  XDBC_SUBCODE_HOUR_TO_MINUTE = 11;
+  XDBC_SUBCODE_HOUR_TO_SECOND = 12;
+  XDBC_SUBCODE_MINUTE_TO_SECOND = 13;
+  XDBC_SUBCODE_INTERVAL_YEAR = 101;
+  XDBC_SUBCODE_INTERVAL_MONTH = 102;
+  XDBC_SUBCODE_INTERVAL_DAY = 103;
+  XDBC_SUBCODE_INTERVAL_HOUR = 104;
+  XDBC_SUBCODE_INTERVAL_MINUTE = 105;
+  XDBC_SUBCODE_INTERVAL_SECOND = 106;
+  XDBC_SUBCODE_INTERVAL_YEAR_TO_MONTH = 107;
+  XDBC_SUBCODE_INTERVAL_DAY_TO_HOUR = 108;
+  XDBC_SUBCODE_INTERVAL_DAY_TO_MINUTE = 109;
+  XDBC_SUBCODE_INTERVAL_DAY_TO_SECOND = 110;
+  XDBC_SUBCODE_INTERVAL_HOUR_TO_MINUTE = 111;
+  XDBC_SUBCODE_INTERVAL_HOUR_TO_SECOND = 112;
+  XDBC_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.

Review comment:
       "other predicates except for LIKE" is difficult to read, is it grammatically correct?

##########
File path: format/FlightSql.proto
##########
@@ -867,6 +867,189 @@ enum SqlSupportsConvert {
   SQL_CONVERT_VARCHAR = 19;
 }
 
+/**
+ * It is an attribute that identifies the type of any object. It's
+ * used by JDBC and ODBC to expose the values defined by the DBMS.
+ * All the values here are the sames as in the JDBC and ODBC specs.

Review comment:
       ```suggestion
    * The JDBC/ODBC-defined type of any object.
    * All the values here are the sames as in the JDBC and ODBC specs.
   ```

##########
File path: format/FlightSql.proto
##########
@@ -867,6 +867,189 @@ enum SqlSupportsConvert {
   SQL_CONVERT_VARCHAR = 19;
 }
 
+/**
+ * It is an attribute that identifies the type of any object. It's
+ * used by JDBC and ODBC to expose the values defined by the DBMS.
+ * All the values here are the sames as in the JDBC and ODBC specs.
+ */
+enum XdbcDataType {
+  XDBC_UNKNOWN_TYPE = 0;
+  XDBC_CHAR = 1;
+  XDBC_NUMERIC = 2;
+  XDBC_DECIMAL = 3;
+  XDBC_INTEGER = 4;
+  XDBC_SMALLINT = 5;
+  XDBC_FLOAT = 6;
+  XDBC_REAL = 7;
+  XDBC_DOUBLE = 8;
+  XDBC_DATETIME = 9;
+  XDBC_INTERVAL = 10;
+  XDBC_VARCHAR = 12;
+  XDBC_DATE = 91;
+  XDBC_TIME = 92;
+  XDBC_TIMESTAMP = 93;
+  XDBC_LONGVARCHAR = -1;
+  XDBC_BINARY = -2;
+  XDBC_VARBINARY = -3;
+  XDBC_LONGVARBINARY = -4;
+  XDBC_BIGINT = -5;
+  XDBC_TINYINT = -6;
+  XDBC_BIT = -7;
+  XDBC_WCHAR = -8;
+  XDBC_WVARCHAR = -9;
+}
+
+/**
+ * When the values returned by the XdbcDataType is XDBC_TYPE_DATETIME or XDBC_TYPE_INTERVAL,
+ * more information about this column can be obtain through the values in this enum.

Review comment:
       ```suggestion
    * Detailed subtype information for XDBC_TYPE_DATETIME and XDBC_TYPE_INTERVAL.
   ```




-- 
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-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org