You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Venki Korukanti (JIRA)" <ji...@apache.org> on 2015/04/15 07:24:58 UTC
[jira] [Updated] (DRILL-2341) Type information is lost if list of
fields is specified during create view
[ https://issues.apache.org/jira/browse/DRILL-2341?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Venki Korukanti updated DRILL-2341:
-----------------------------------
Attachment: DRILL-2341-1.patch
> Type information is lost if list of fields is specified during create view
> --------------------------------------------------------------------------
>
> Key: DRILL-2341
> URL: https://issues.apache.org/jira/browse/DRILL-2341
> Project: Apache Drill
> Issue Type: Bug
> Components: Metadata
> Affects Versions: 0.8.0
> Reporter: Victoria Markman
> Assignee: Venki Korukanti
> Fix For: 0.9.0
>
> Attachments: DRILL-2341-1.patch
>
>
> List of fields is not provided, type information is correct.
> {code}
> 0: jdbc:drill:schema=dfs> create view v1 as select cast(a1 as int), cast(b1 as varchar(10)), cast(c1 as date) from t1;
> +------------+------------+
> | ok | summary |
> +------------+------------+
> | true | View 'v1' created successfully in 'dfs.aggregation' schema |
> +------------+------------+
> 1 row selected (0.063 seconds)
> 0: jdbc:drill:schema=dfs> describe v1;
> +-------------+------------+-------------+
> | COLUMN_NAME | DATA_TYPE | IS_NULLABLE |
> +-------------+------------+-------------+
> | EXPR$0 | INTEGER | NO |
> | EXPR$1 | VARCHAR | NO |
> | EXPR$2 | DATE | NO |
> +-------------+------------+-------------+
> 3 rows selected (0.102 seconds)
> {code}
> List of fields is specified, type information is lost
> {code}
> 0: jdbc:drill:schema=dfs> create view v2(x,y,z) as select cast(a1 as int), cast(b1 as varchar(10)), cast(c1 as date) from t1;
> +------------+------------+
> | ok | summary |
> +------------+------------+
> | true | View 'v2' created successfully in 'dfs.aggregation' schema |
> +------------+------------+
> 1 row selected (0.049 seconds)
> 0: jdbc:drill:schema=dfs> describe v2;
> +-------------+------------+-------------+
> | COLUMN_NAME | DATA_TYPE | IS_NULLABLE |
> +-------------+------------+-------------+
> | x | ANY | NO |
> | y | ANY | NO |
> | z | ANY | NO |
> +-------------+------------+-------------+
> 3 rows selected (0.084 seconds)
> {code}
> View file:
> {code}
> {
> "name" : "v2",
> "sql" : "SELECT CAST(`a1` AS INTEGER), CAST(`b1` AS VARCHAR(10)), CAST(`c1` AS DATE)\nFROM `t1`",
> "fields" : [ {
> "name" : "x",
> "type" : "ANY",
> "isNullable" : true
> }, {
> "name" : "y",
> "type" : "ANY",
> "isNullable" : true
> }, {
> "name" : "z",
> "type" : "ANY",
> "isNullable" : true
> } ],
> "workspaceSchemaPath" : [ "dfs", "aggregation" ]
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)