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

Paul Rogers edited comment on DRILL-7308 at 6/25/19 4:41 AM:
-------------------------------------------------------------

This issue points out a unfortunate reality (IMHO): lack of unit tests for the 
REST API. We have nothing, other than vigilent users, to track down issues such 
as this one.

I believe that unit tests can be easily created: use a {{ClusterTest}} and set 
the config\(?) option to enable the web server. Use a web client of some sort 
to fire a request. Either compare the results against a golden file, or just 
test for the bits of interest (such as, for DRILL-6847, test against each type 
and mode, and with and without width/precision, and verify just that part of 
the result.

The unit test would also allow very easy debugging. It seems the best we can do 
at present is build all of Drill, start it, and connect a remote debugger. This 
is so cumbersome that folks will avoid stepping through code to see if it works.


was (Author: paul.rogers):
This issue points out a unfortunate reality (IMHO): lack of unit tests for the 
REST API. We have nothing, other than vigilent users, to track down issues such 
as this one.

I believe that unit tests can be easily created: use a {{ClusterTest}} and set 
the config(?) option to enable the web server. Use a web client of some sort to 
fire a request. Either compare the results against a golden file, or just test 
for the bits of interest (such as, for DRILL-6847, test against each type and 
mode, and with and without width/precision, and verify just that part of the 
result.

The unit test would also allow very easy debugging. It seems the best we can do 
at present is build all of Drill, start it, and connect a remote debugger. This 
is so cumbersome that folks will avoid stepping through code to see if it works.

> Incorrect Metadata from text file queries
> -----------------------------------------
>
>                 Key: DRILL-7308
>                 URL: https://issues.apache.org/jira/browse/DRILL-7308
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Metadata
>    Affects Versions: 1.17.0
>            Reporter: Charles Givre
>            Priority: Major
>         Attachments: Screen Shot 2019-06-24 at 3.16.40 PM.png, domains.csvh
>
>
> I'm noticing some strange behavior with the newest version of Drill.  If you 
> query a CSV file, you get the following metadata:
> {code:sql}
> SELECT * FROM dfs.test.`domains.csvh` LIMIT 1
> {code}
> {code:json}
> {
>   "queryId": "22eee85f-c02c-5878-9735-091d18788061",
>   "columns": [
>     "domain"
>   ],
>   "rows": [}
>    {       "domain": "thedataist.com"     }  ],
>   "metadata": [
>     "VARCHAR(0, 0)",
>     "VARCHAR(0, 0)"
>   ],
>   "queryState": "COMPLETED",
>   "attemptedAutoLimit": 0
> }
> {code}
> There are two issues here:
> 1.  VARCHAR now has precision
> 2.  There are twice as many columns as there should be.
> Additionally, if you query a regular CSV, without the columns extracted, you 
> get the following:
> {code:json}
>  "rows": [
>  { 
>       "columns": "[\"ACCT_NUM\",\"PRODUCT\",\"MONTH\",\"REVENUE\"]"     }
>   ],
>    "metadata": [
>      "VARCHAR(0, 0)",
>      "VARCHAR(0, 0)"
>    ],
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to