You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Aman Sinha (JIRA)" <ji...@apache.org> on 2015/01/18 00:47:34 UTC

[jira] [Commented] (DRILL-2030) CTAS with SELECT * and expression creates column names with prefix

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

Aman Sinha commented on DRILL-2030:
-----------------------------------

Note from the explain plan that the top level Project which is supposed to strip the prefix is above the Writer rather than below. 
{code}
    Screen
      ProjectAllowDup(Fragment=[$0], Number of records written=[$1])
        Writer
          Project(T0¦¦*=[$0], EXPR$1=[+($1, 1)])
            Project(T0¦¦*=[$0], r_regionkey=[$1])
              Scan(groupscan=[ParquetGroupScan [entries=[ReadEntryWithPath [path=/tpch/region.parquet]], selectionRoot=/tpch/region.parquet, numFiles=1, columns=[`*`]]])
{code}

> CTAS with SELECT * and expression creates column names with prefix
> ------------------------------------------------------------------
>
>                 Key: DRILL-2030
>                 URL: https://issues.apache.org/jira/browse/DRILL-2030
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Query Planning & Optimization
>    Affects Versions: 0.7.0
>            Reporter: Aman Sinha
>            Assignee: Jinfeng Ni
>
> Doing a CTAS with the star column and an expression creates columns that contain the table prefix 'T||' .  Looks like the top project did not strip out the prefix. 
> {code}
> 0: jdbc:drill:zk=local> create table region4 as select *, r_regionkey + 1 from cp.`tpch/region.parquet`;
> +------------+---------------------------+
> |  Fragment  | Number of records written |
> +------------+---------------------------+
> | 0_0        | 5                         |
> +------------+---------------------------+
> 0: jdbc:drill:zk=local> select * from region4;
> +-----------------+------------+---------------+------------+
> | T2¦¦r_regionkey | T2¦¦r_name | T2¦¦r_comment |   EXPR$1   |
> +-----------------+------------+---------------+------------+
> {code}
> The column names are correct if there is a regular column with the star column. 



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