[ 
https://issues.apache.org/jira/browse/DRILL-3374?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Khurram Faraaz updated DRILL-3374:
----------------------------------
    Description: 
CTAS with PARTITION BY clause fails to resolve column name when partitioning 
column is from a view.

{code}
0: jdbc:drill:schema=dfs.tmp> create table ctas_prtng_01 partition by 
(col_vchar_52) as select * from vwOnParq_wCst;
Error: SYSTEM ERROR: IllegalArgumentException: partition col col_vchar_52 could 
not be resolved in table's column lists!


[Error Id: 7cb227c1-65c5-48cb-a00b-1a89a5309bc8 on centos-04.qa.lab:31010] 
(state=,code=0)
{code}

Table used in above CTAS does exist and the column used to partition by also 
exists.
{code}
0: jdbc:drill:schema=dfs.tmp> describe vwOnParq_wCst;
+---------------+--------------------+--------------+
|  COLUMN_NAME  |     DATA_TYPE      | IS_NULLABLE  |
+---------------+--------------------+--------------+
| col_int       | INTEGER            | YES          |
| col_bigint    | BIGINT             | YES          |
| col_char_2    | CHARACTER          | YES          |
| col_vchar_52  | CHARACTER VARYING  | YES          |
| col_tmstmp    | TIMESTAMP          | YES          |
| col_dt        | DATE               | YES          |
| col_booln     | BOOLEAN            | YES          |
| col_dbl       | DOUBLE             | YES          |
| col_tm        | TIME               | YES          |
+---------------+--------------------+--------------+
9 rows selected (0.411 seconds)
{code}

  was:
We need to return message that CTAS with PARTITION BY clause is only supported 
over parquet files.

{code}
0: jdbc:drill:schema=dfs.tmp> create table ctas_prtng_01 partition by 
(col_vchar_52) as select * from vwOnParq_wCst;
Error: SYSTEM ERROR: IllegalArgumentException: partition col col_vchar_52 could 
not be resolved in table's column lists!


[Error Id: 7cb227c1-65c5-48cb-a00b-1a89a5309bc8 on centos-04.qa.lab:31010] 
(state=,code=0)
{code}

Table used in above CTAS does exist and the column used to partition by also 
exists.
{code}
0: jdbc:drill:schema=dfs.tmp> describe vwOnParq_wCst;
+---------------+--------------------+--------------+
|  COLUMN_NAME  |     DATA_TYPE      | IS_NULLABLE  |
+---------------+--------------------+--------------+
| col_int       | INTEGER            | YES          |
| col_bigint    | BIGINT             | YES          |
| col_char_2    | CHARACTER          | YES          |
| col_vchar_52  | CHARACTER VARYING  | YES          |
| col_tmstmp    | TIMESTAMP          | YES          |
| col_dt        | DATE               | YES          |
| col_booln     | BOOLEAN            | YES          |
| col_dbl       | DOUBLE             | YES          |
| col_tm        | TIME               | YES          |
+---------------+--------------------+--------------+
9 rows selected (0.411 seconds)
{code}

        Summary: CTAS with PARTITION BY, partition column name from view can 
not be defined  (was: Need a better error message - CTAS with PARTITION BY)

> CTAS with PARTITION BY, partition column name from view can not be defined
> --------------------------------------------------------------------------
>
>                 Key: DRILL-3374
>                 URL: https://issues.apache.org/jira/browse/DRILL-3374
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Execution - Flow
>    Affects Versions: 1.1.0
>            Reporter: Khurram Faraaz
>            Assignee: Steven Phillips
>              Labels: window_function
>             Fix For: 1.2.0
>
>
> CTAS with PARTITION BY clause fails to resolve column name when partitioning 
> column is from a view.
> {code}
> 0: jdbc:drill:schema=dfs.tmp> create table ctas_prtng_01 partition by 
> (col_vchar_52) as select * from vwOnParq_wCst;
> Error: SYSTEM ERROR: IllegalArgumentException: partition col col_vchar_52 
> could not be resolved in table's column lists!
> [Error Id: 7cb227c1-65c5-48cb-a00b-1a89a5309bc8 on centos-04.qa.lab:31010] 
> (state=,code=0)
> {code}
> Table used in above CTAS does exist and the column used to partition by also 
> exists.
> {code}
> 0: jdbc:drill:schema=dfs.tmp> describe vwOnParq_wCst;
> +---------------+--------------------+--------------+
> |  COLUMN_NAME  |     DATA_TYPE      | IS_NULLABLE  |
> +---------------+--------------------+--------------+
> | col_int       | INTEGER            | YES          |
> | col_bigint    | BIGINT             | YES          |
> | col_char_2    | CHARACTER          | YES          |
> | col_vchar_52  | CHARACTER VARYING  | YES          |
> | col_tmstmp    | TIMESTAMP          | YES          |
> | col_dt        | DATE               | YES          |
> | col_booln     | BOOLEAN            | YES          |
> | col_dbl       | DOUBLE             | YES          |
> | col_tm        | TIME               | YES          |
> +---------------+--------------------+--------------+
> 9 rows selected (0.411 seconds)
> {code}



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

Reply via email to