You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@drill.apache.org by jn...@apache.org on 2017/03/02 20:59:38 UTC

[11/27] drill git commit: DRILL-5301: Server metadata API

http://git-wip-us.apache.org/repos/asf/drill/blob/d2e0f415/protocol/src/main/protobuf/User.proto
----------------------------------------------------------------------
diff --git a/protocol/src/main/protobuf/User.proto b/protocol/src/main/protobuf/User.proto
index ef993cc..4b722b3 100644
--- a/protocol/src/main/protobuf/User.proto
+++ b/protocol/src/main/protobuf/User.proto
@@ -5,6 +5,7 @@ option java_outer_classname = "UserProtos";
 option optimize_for = SPEED;
 
 import "SchemaDef.proto";
+import "Types.proto";
 import "UserBitShared.proto";
 import "BitData.proto";
 import "BitControl.proto";
@@ -27,6 +28,7 @@ enum RpcType {
   GET_TABLES = 16; // user is requesting metadata of table(s)
   GET_COLUMNS = 17; // user is requesting metadata of column(s)
   CREATE_PREPARED_STATEMENT = 22; // user is sending a request to create prepared statement
+  GET_SERVER_META = 8; // user is sending a request to receive server metadata
 
   // bit to user
   QUERY_DATA = 6; // drillbit is sending a query result data batch to the user
@@ -37,9 +39,7 @@ enum RpcType {
   TABLES = 20; // return table metadata in response to GET_TABLES
   COLUMNS = 21; // return column metadata in response to GET_COLUMNS
   PREPARED_STATEMENT = 23; // return preparated statement in response to CREATE_PREPARED_STATEMENT
-
-  REQ_META_FUNCTIONS = 8;
-  RESP_FUNCTION_LIST = 9;
+  SERVER_META = 9; // return server infos in respose to GET_SERVER_META
 
   QUERY_RESULT = 10; // drillbit is reporting a query status change, most likely a terminal message, to the user
 
@@ -439,6 +439,219 @@ message CreatePreparedStatementResp {
 }
 
 /*
+ * Request message for getting server metadata
+ */
+message GetServerMetaReq {
+}
+
+enum CollateSupport {
+    CS_UNKNOWN      = 0;   // Unknown support (for forward compatibility)
+    CS_GROUP_BY     = 1;   // COLLATE clause can be added after each grouping column
+}
+message ConvertSupport {
+  required common.MinorType from = 1;
+  required common.MinorType to = 2;
+}
+
+enum CorrelationNamesSupport {
+    CN_NONE = 1;               // Correlation names are not supported
+    CN_DIFFERENT_NAMES = 2;    // Correlation names are supported, but names have to
+                               // be different from the tables they represent
+    CN_ANY = 3;                // Correlation names are supported without restriction
+}
+
+enum DateTimeLiteralsSupport {
+    DL_UNKNOWN = 0;                    // Unknown support (for forward compatibility)
+    DL_DATE = 1;                       // DATE literal is supported
+    DL_TIME = 2;                       // TIME literal is supported
+    DL_TIMESTAMP = 3;                  // TIMESTAMP literal is supported
+    DL_INTERVAL_YEAR = 4;              // INTERVAL YEAR literal is supported
+    DL_INTERVAL_MONTH = 5;             // INTERVAL MONTH literal is supported
+    DL_INTERVAL_DAY = 6;               // INTERVAL DAY literal is supported
+    DL_INTERVAL_HOUR = 7;              // INTERVAL HOUR literal is supported
+    DL_INTERVAL_MINUTE = 8;            // INTERVAL MINUTE literal is supported
+    DL_INTERVAL_SECOND = 9;            // INTERVAL SECOND literal is supported
+    DL_INTERVAL_YEAR_TO_MONTH = 10;    // INTERVAL YEAR TO MONTH literal is supported
+    DL_INTERVAL_DAY_TO_HOUR = 11;      // INTERVAL DAY TO HOUR literal is supported
+    DL_INTERVAL_DAY_TO_MINUTE = 12;    // INTERVAL DAY TO MINUTE literal is supported
+    DL_INTERVAL_DAY_TO_SECOND = 13;    // INTERVAL DAY TO SECOND literal is supported
+    DL_INTERVAL_HOUR_TO_MINUTE = 14;   // INTERVAL HOUR TO MINUTE literal is supported
+    DL_INTERVAL_HOUR_TO_SECOND = 15;   // INTERVAL HOUR TO SECOND literal is supported
+    DL_INTERVAL_MINUTE_TO_SECOND = 16; // INTERVAL MINUTE TO SECOND literal is supported
+}
+
+enum GroupBySupport {
+    GB_NONE = 1;           // Group by is not supported
+    GB_SELECT_ONLY = 2;    // Group by supported with non aggregated columns in select
+    GB_BEYOND_SELECT = 3;  /* Group by supported with columns absent from the select list
+                              if all the non-aggregated colums from the select list are also added */
+    GB_UNRELATED = 4;      // Group by supported with columns absent from the select list
+}
+
+enum IdentifierCasing {
+    IC_UNKNOWN = 0;        // Unknown support (for forward compatibility)
+    IC_STORES_LOWER = 1;   /* Mixed case identifier is treated as case insensitive
+                              and stored in lower case */
+    IC_STORES_MIXED = 2;   /* Mixed case identifier is treated as case insensitive
+                              and stored in mixed case */
+    IC_STORES_UPPER = 3;   /* Mixed case identifier is treated as case insensitive
+                              and stored in upper case */
+    IC_SUPPORTS_MIXED = 4; /* Mixed case identifier is treated as case sensitive
+                              and stored in mixed case */
+}
+
+enum NullCollation {
+    NC_UNKNOWN   = 0;  // Unknown support (for forward compatibility)
+    NC_AT_START  = 1;  // NULL values are sorted at the start regardless of the order
+    NC_AT_END = 2;     // NULL values are sorted at the end regardless of the order
+    NC_HIGH = 3;       // NULL is the highest value
+    NC_LOW = 4;        // NULL is the lowest value
+}
+
+enum OrderBySupport {
+    OB_UNKNOWN = 0;     // Unknown support (for forward compatibility)
+    OB_UNRELATED = 1;   // ORDER BY supported with columns not in SELECT list
+    OB_EXPRESSION = 2;  // ORDER BY with expressions is supported
+}
+
+enum OuterJoinSupport {
+    OJ_UNKNOWN = 0;            // Unknown support (for forward compatibility)
+    OJ_LEFT = 1;               // Left outer join is supported
+    OJ_RIGHT = 2;              // Right outer join is supported
+    OJ_FULL = 3;               // Full outer join is supported
+    OJ_NESTED = 4;             // Nested outer join is supported
+    OJ_NOT_ORDERED = 5;        /* Column names in the ON clause don't have to share the same order
+                                  as their respective table names in the OUTER JOIN clase */
+    OJ_INNER = 6;              // Inner table can also be used in an inner join
+    OJ_ALL_COMPARISON_OPS = 7; // Any comparison operator is supported in the ON clause
+}
+
+enum SubQuerySupport {
+    SQ_UNKNOWN    = 0;     // Unknown support (for forward compatibility)
+    SQ_CORRELATED = 1;     // Correlated subquery is supported
+    SQ_IN_COMPARISON = 2;  // Subquery in comparison expression is supported
+    SQ_IN_EXISTS = 3;      // Subquery in EXISTS expression is supported
+    SQ_IN_INSERT = 4;      // Subquery in INSERT expression is supported
+    SQ_IN_QUANTIFIED = 5;  // Subquery in quantified expression is supported
+}
+
+enum UnionSupport {
+    U_UNKNOWN = 0;    // Unknown support (for forward compatibility)
+    U_UNION = 1;      // UNION is supported
+    U_UNION_ALL = 2;  // UNION_ALL is supported
+}
+
+/*
+ * Response message for GetServerMetaReq
+ */
+message GetServerMetaResp {
+  optional RequestStatus status = 1;
+  optional ServerMeta server_meta = 2;
+  optional exec.shared.DrillPBError error = 3;
+}
+
+message ServerMeta {
+    // True if current user can use all tables returned by GetTables
+    optional bool                       all_tables_selectable = 1;
+    // True if BLOB are included into the max row size
+    optional bool                       blob_included_in_max_row_size = 2;
+    // True if catalog name is at the start of a fully qualified table
+    optional bool                       catalog_at_start = 3;
+    // The catalog separator
+    optional string                     catalog_separator = 4;
+    // The term used to designate catalogs
+    optional string                     catalog_term = 5;
+    // COLLATE support
+    repeated CollateSupport             collate_support = 6;
+    // True if column aliasing is supported
+    optional bool                       column_aliasing_supported = 7;
+    // CONVERT support
+    repeated ConvertSupport             convert_support = 8;
+    // Correlation names support
+    optional CorrelationNamesSupport    correlation_names_support = 9;
+    // Supported ODBC/JDBC Date Time scalar functions
+    repeated string                     date_time_functions = 10;
+    // Supported Date Time literals
+    repeated DateTimeLiteralsSupport    date_time_literals_support = 11;
+    // Group By support
+    optional GroupBySupport             group_by_support = 12;
+    // Unquoted Identifier casing
+    optional IdentifierCasing           identifier_casing = 13;
+    // Quote string for identifiers
+    optional string                     identifier_quote_string = 14;
+    // True if LIKE supports an ESCAPE clause
+    optional bool                       like_escape_clause_supported = 15;
+    // Maximum number of hexa characters for binary literals (0 if unlimited or unknown)
+    optional uint32                     max_binary_literal_length = 16;
+    // Maximum length of catalog names (0 if unlimited or unknown)
+    optional uint32                     max_catalog_name_length = 17;
+    // Maximum number of characters for string literals (0 if unlimited or unknown)
+    optional uint32                     max_char_literal_length = 18;
+    // Maximum length of column names (0 if unlimited or unknown)
+    optional uint32                     max_column_name_length = 19;
+    // Maximum number of columns in GROUP BY expressions (0 if unlimited or unknown)
+    optional uint32                     max_columns_in_group_by = 20;
+    // Maximum number of columns in ORDER BY expressions (0 if unlimited or unknown)
+    optional uint32                     max_columns_in_order_by = 21;
+    // Maximum number of columns in SELECT expressions (0 if unlimited or unknown)
+    optional uint32                     max_columns_in_select = 22;
+    // Maximum length of cursor names (0 if unlimited or unknown)
+    optional uint32                     max_cursor_name_length = 23;
+    // Maximum logical size for LOB types (0 if unlimited or unknown)
+    optional uint32                     max_logical_lob_size = 24;
+    // Maximum number of bytes for a single row (0 if unlimited or unknown)
+    optional uint32                     max_row_size = 25;
+    // Maximum length of schema names (0 if unlimited or unknown)
+    optional uint32                     max_schema_name_length = 26;
+    // Maximum length for statements (0 if unlimited or unknown)
+    optional uint32                     max_statement_length = 27;
+    // Maximum number of statements (0 if unlimited or unknown)
+    optional uint32                     max_statements = 28;
+    // Maximum length of table names (0 if unlimited or unknown)
+    optional uint32                     max_table_name_length = 29;
+    // Maximum number of tables in a SELECT expression (0 if unlimited or unknown)
+    optional uint32                     max_tables_in_select = 30;
+    // Maximum length of user names (0 if unlimited or unknown)
+    optional uint32                     max_user_name_length = 31;
+    // How NULL are sorted
+    optional NullCollation              null_collation = 32;
+    // True if NULL + non NULL is NULL
+    optional bool                       null_plus_non_null_equals_null = 33;
+    // Supported ODBC/JDBC numeric scalar functions
+    repeated string                     numeric_functions = 34;
+    // Outer join suport
+    repeated OrderBySupport             order_by_support = 35;
+    // Outer join suport
+    repeated OuterJoinSupport           outer_join_support = 36;
+    // Quoted identifier casing
+    optional IdentifierCasing           quoted_identifier_casing = 37;
+    // True if connection access is read only
+    optional bool                       read_only = 38;
+    // The term used to designate a schema
+    optional string                     schema_term = 39;
+    // Characters used for escaping (empty if not suported)
+    optional string                     search_escape_string = 40;
+    // True if SELECT FOR UPDATE is supported
+    optional bool                       select_for_update_supported = 41;
+    // List of extra characters that can be used in identifier names
+    optional string                     special_characters = 42;
+    // list of SQL keywords
+    repeated string                     sql_keywords = 43;
+    // Supported ODBC/JDBC string scalar functions
+    repeated string                     string_functions = 44;
+    // Subquery support
+    repeated SubQuerySupport            subquery_support = 45;
+    // Supported ODBC/JDBC systen scalar functions
+    repeated string                     system_functions = 46;
+    // The term used to designate a table
+    optional string                     table_term = 47;
+    // True if transaction is supported
+    optional bool                       transaction_supported = 48;
+    // UNION support
+    repeated UnionSupport               union_support = 49;
+}
+
+/*
  * Request message for running a query.
  */
 message RunQuery {