[
https://issues.apache.org/jira/browse/DRILL-2346?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14586485#comment-14586485
]
Khurram Faraaz commented on DRILL-2346:
---------------------------------------
This is still seen on 1.0 on level 3bccec91, adding this information here since
the JIRA was marked as Resolved.
{code}
0: jdbc:drill:schema=dfs.tmp> create view
view_for_winFns(col_int,col_bgint,col_chr,col_vrchr,col_tmstmp,col_dt,col_boln,col_dbl,col_tim)
as select * from `allDataInPrq/0_0_0.parquet`;
Error: VALIDATION ERROR: view's field list and the view's query field list have
different counts.
[Error Id: 75b4fa33-c59f-47fa-bd9d-dca269f4acea on centos-01.qa.lab:31010]
(state=,code=0)
{code}
Using all the column names in the SELECT clause of CREATE VIEW statement works.
{code}
0: jdbc:drill:schema=dfs.tmp> create view
view_for_winFns(col_int,col_bgint,col_chr,col_vrchr,col_tmstmp,col_dt,col_boln,col_dbl,col_tim)
as select
col_int,col_bgint,col_chr,col_vrchr,col_tmstmp,col_dt,col_boln,col_dbl,col_tim
from `allDataInPrq/0_0_0.parquet`;
+-------+------------------------------------------------------------------+
| ok | summary |
+-------+------------------------------------------------------------------+
| true | View 'view_for_winFns' created successfully in 'dfs.tmp' schema |
+-------+------------------------------------------------------------------+
1 row selected (0.208 seconds)
{code}
> Star is not expanded correctly in create view if view fields are specified
> --------------------------------------------------------------------------
>
> Key: DRILL-2346
> URL: https://issues.apache.org/jira/browse/DRILL-2346
> Project: Apache Drill
> Issue Type: Bug
> Components: Query Planning & Optimization
> Affects Versions: 0.8.0
> Reporter: Victoria Markman
> Assignee: Jinfeng Ni
> Priority: Minor
> Fix For: 1.1.0
>
>
> {code}
> 0: jdbc:drill:schema=dfs> select * from t2 limit 1;
> +------------+------------+------------+
> | a2 | b2 | c2 |
> +------------+------------+------------+
> | 0 | zzz | 2014-12-31 |
> +------------+------------+------------+
> 1 row selected (0.065 seconds)
> {code}
> We get an error, even though table t2 has 3 columns:
> {code}
> 0: jdbc:drill:schema=dfs> create view v2(a2, b2, c2) as select * from t2;
> +------------+------------+
> | ok | summary |
> +------------+------------+
> | false | View's field list and View's query field list have different
> counts. |
> +------------+------------+
> 1 row selected (0.038 seconds)
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)