drill-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Barclay (Drill) (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DRILL-3356) RPC-level data is missing data needed for result set metadata
Date Thu, 25 Jun 2015 05:13:04 GMT

    [ https://issues.apache.org/jira/browse/DRILL-3356?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14600699#comment-14600699
] 

Daniel Barclay (Drill) commented on DRILL-3356:
-----------------------------------------------

It seems that protobuf type {{MajorType}} and its use need some changes:

1. The length of string types (e.g., _N_ in {{VARBINARY(_N_)}}) needs to be represented.
2. The leading field precision of interval types (e.g., _N_ in {{INTERVAL HOUR(_N_) TO SECOND}})
needs to be represented.
3. The fractional seconds precision of interval types (e.g., _N_ in {{INTERVAL HOUR TO SECOND(_N_)}})
needs to be represented.
4. The fractional seconds precision of datetime types (e.g., _N_ in {{TIME(_N_)}}) needs to
be represented.
5. The combination of interval start and end units for interval types (e.g., {{HOUR... TO
MINUTE}} vs. {{HOUR}}, etc.) needs to be represented.

MajorType is current defined like this:

{noformat}
message MajorType {
  optional MinorType minor_type = 1;
  optional DataMode mode = 2;
  optional int32 width = 3; // optional width for fixed size values.
  optional int32 precision = 4; // used for decimal types
  optional int32 scale = 5; // used for decimal types
  optional int32 timeZone = 6; // used by TimeStamp type
}
{noformat}

Items 1, 2, 3, and 4 could use {{MajorType}}'s existing {{precision}} and {{scale}} fields
(as {{org.apache.drill.exec.dotdrill.View.FieldType}} uses its {{precision}} and {{scale}}
similarly).   The required change would be to pass values in those fields, but would not require
a change to {{MajorType}}.

(If {{MajorType}}'s {{width}} field is for string types (e.g, the 5 in {{BINARY(5)}}), then
it could be re-specified to also be the maximum width for variable-length string types  (e.g.,
the 5 in {{CHARACTER VARYING(5)}}.  That might be clearer than using the {{precision}}, although
several other layers already use fields/methods/etc. named with "precision" for string lengths
(e.g., Calcite, JDBC, View.FieldType).)


Item 5 needs an additional field or fields in {{MajorType}} (well, barring ugly hacks).  It
could be two unit fields, as in {{View.FieldType}}, or it could be one field representing
the combination of start and end units.  (There are 13 possible combinations.)


> RPC-level data is missing data needed for result set metadata 
> --------------------------------------------------------------
>
>                 Key: DRILL-3356
>                 URL: https://issues.apache.org/jira/browse/DRILL-3356
>             Project: Apache Drill
>          Issue Type: Bug
>            Reporter: Daniel Barclay (Drill)
>
> The result set metadata (schema data) available on the client side is missing data needed
by some jdbc.sql.ResultSetMetaData methods.  See DRILL-3355.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message