You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Denys Ordynskiy (JIRA)" <ji...@apache.org> on 2019/08/09 15:52:00 UTC

[jira] [Comment Edited] (DRILL-7342) Drill replacing spaces with underlines in the column names of text files with headers

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

Denys Ordynskiy edited comment on DRILL-7342 at 8/9/19 3:51 PM:
----------------------------------------------------------------

Drill allows spaces in the column names for *parquet tables*:
Update Drill ctas format option to generate parquet table:
{noformat}
set `store.format` = 'parquet';
{noformat}
Create parquet table with column names having spaces:
{noformat}
create table dfs.tmp.`parquet table with spaces` (`Full Name`) as select 'James Bond' from (values(1));
{noformat}
Try to query this table without column name:
{noformat}
select * from dfs.tmp.`parquet table with spaces`;
{noformat}
|{color:green}*Full Name*{color}|
|James Bond|
Try to query this table with column name:
{noformat}
select `Full Name` from dfs.tmp.`parquet table with spaces`;
{noformat}
|Full Name|
|{color:green}*James Bond*{color}|


was (Author: denysord88):
Drill allows spaces in the column names for parquet tables:
Update Drill ctas format option to generate parquet table:
{noformat}
set `store.format` = 'parquet';
{noformat}
Create parquet table with column names having spaces:
{noformat}
create table dfs.tmp.`parquet table with spaces` (`Full Name`) as select 'James Bond' from (values(1));
{noformat}
Try to query this table without column name:
{noformat}
select * from dfs.tmp.`parquet table with spaces`;
{noformat}
|{color:green}*Full Name*{color}|
|James Bond|
Try to query this table with column name:
{noformat}
select `Full Name` from dfs.tmp.`parquet table with spaces`;
{noformat}
|Full Name|
|{color:green}*James Bond*{color}|

> Drill replacing spaces with underlines in the column names of text files with headers
> -------------------------------------------------------------------------------------
>
>                 Key: DRILL-7342
>                 URL: https://issues.apache.org/jira/browse/DRILL-7342
>             Project: Apache Drill
>          Issue Type: Bug
>            Reporter: Denys Ordynskiy
>            Priority: Major
>
> Drill doesn't allow to query csvh columns with spaces.
>  *Description:*
>  Update Drill ctas format option to generate text file with header:
> {noformat}
> set `store.format` = 'csvh';
> {noformat}
> Create table with column names having spaces:
> {noformat}
> create table dfs.tmp.`csv table with spaces` (`Full Name`) as select 'James Bond' from (values(1));
> {noformat}
> Drill wrote column name with space:
> {noformat}
> hadoop fs -cat '/tmp/csv table with spaces/0_0_0.csvh'
> {noformat}
> |Full Name|
> |James Bond|
> Try to query this table without column name:
> {noformat}
> select * from dfs.tmp.`csv table with spaces`;
> {noformat}
> |{color:#ff0000}*Full_Name*{color}|
> |James Bond|
> {color:#ff0000}*Drill replaced space with underline.*{color}
>  Try to select `Full Name` column with space:
> {noformat}
> select `Full Name` from dfs.tmp.`csv table with spaces`;
> {noformat}
> Drill
> |Full Name|
> | |
> When I changed space to underline, query returned the data:
> {noformat}
> select `Full_Name` from dfs.tmp.`csv table with spaces`;
> {noformat}
> |Full_Name|
> |James Bond|
> Drill can create csvh text files with spaces in the column names. But it's impossible to request data using the original column name.
> *Expected result*
>  Space should be available character in the column names.



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)