drill-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Rogers (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DRILL-5492) CSV with spaces for header uses spaces as field name
Date Tue, 09 May 2017 05:33:04 GMT

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

Paul Rogers commented on DRILL-5492:
------------------------------------

The fun never ends. Now try this file:

{code}
 *@! , )( , -_-   
a,b,c
d,e,f
{code}

There are spaces before and after each field.

The code returns the following as column headers:

{code}
[" *@! ","  )( ","  -_-  " ]
{code}

With the following as the output:

{code}
2 row(s):
 *@! , )( , -_-   
a,b,c
d,e,f
{code}

Note that the non-symbol characters are allowed as names, and that the whitespace in the "names"
is preserved.

Expected whitespace to be remove to allow headings of the form:

{code}
first, second, third
{code}

Expected Drill to reject field names that are not valid Drill symbols, or convert the names
to some benign form.

> CSV with spaces for header uses spaces as field name
> ----------------------------------------------------
>
>                 Key: DRILL-5492
>                 URL: https://issues.apache.org/jira/browse/DRILL-5492
>             Project: Apache Drill
>          Issue Type: Bug
>            Reporter: Paul Rogers
>            Priority: Minor
>
> Consider the same test case as in DRILL-5491, but with a slightly different input file:
> {code}
> ___
> a,b,c
> d,e,f
> {code}
> The underscores represent three spaces: use spaces in the real test.
> In this case, the code discussed in DRILL-5491 finds some characters and happily returns
the following array:
> {code}
> ["   "]
> {code}
> The field name of three blanks is returned to the client to produce the following bizarre
output:
> {code}
> 2 row(s):
>     
> a
> d
> {code}
> The blank line is normally the header, but the header here was considered to be three
blanks. (In fact, the blanks are actually printed.)
> Since the blanks were considered to be a field, the file is assumed to have only one
field, so only the first column was returned.
> The expected behavior is that spaces are trimmed from field names, so the field name
list would be empty and a User Error thrown. (That is, it is confusing to the user why a blank
line produces NPE, some produce the {{ExecutionSetupException}} shown in DRILL-5491, and some
produce blank headings. Behavior should be consistent.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message