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

ASF GitHub Bot commented on DRILL-7358:
---------------------------------------

arina-ielchiieva commented on issue #1867: DRILL-7358: Fix COUNT(*) for empty 
text files
URL: https://github.com/apache/drill/pull/1867#issuecomment-538964234
 
 
   +1, @paul-rogers thanks for making the changes.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> Text reader returns nothing for count queries over empty files
> --------------------------------------------------------------
>
>                 Key: DRILL-7358
>                 URL: https://issues.apache.org/jira/browse/DRILL-7358
>             Project: Apache Drill
>          Issue Type: Bug
>    Affects Versions: 1.16.0
>            Reporter: Arina Ielchiieva
>            Assignee: Paul Rogers
>            Priority: Major
>             Fix For: 1.17.0
>
>
> If we do count over empty CSV files (with or without headers), there is no 
> result.
> Though expecting result is 0.
> Unit tests examples:
> {code}
> @Test
> public void testCount() throws Exception {
>   String fileName = "headersOnly.csv";
>   try (PrintWriter out = new PrintWriter(new FileWriter(new File(testDir, 
> fileName)))) {
>     out.print("a,b,c"); // note: no \n in the end
>   }
>   queryBuilder().sql("SELECT count(1) FROM `dfs.data`.`" + fileName + 
> "`").print();
> }
> {code}
> {code}
> @Test
> public void testCount() throws Exception {
>   String fileName = "empty.csv";
>   File file = new File(testDir, fileName);
>   assertTrue(file.createNewFile());
>   queryBuilder().sql("SELECT count(1) FROM `dfs.data`.`" + fileName + 
> "`").print();
> }
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to