Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
Impala 2.5.0
Description
Adding a leading comment line before the 'use <dbname>' command causing unwanted extra blank lines in the query result. Below are the steps to reproduce the problem:
[root@morhidi-572-sec-1 ~]# myimpala -V -f sample.sql --print_header --output_delimiter='|' -B -o result.csv Connected to morhidi-572-sec-2.gce.cloudera.com:21000 Server version: impalad version 2.5.0-cdh5.7.2 RELEASE (build 1140f8289dc0d2b1517bcf70454bb4575eb8cc70) Query: -- comment use default Fetched 0 row(s) in 0.01s Query: select * from sample_07 limit 10 Fetched 10 row(s) in 0.14s
The two extra blank lines can be seen before the query header:
[root@morhidi-572-sec-1 ~]# cat result.csv code|description|total_emp|salary 00-0000|All Occupations|134354250|40690 11-0000|Management occupations|6003930|96150 11-1011|Chief executives|299160|151370 11-1021|General and operations managers|1655410|103780 11-1031|Legislators|61110|33880 11-2011|Advertising and promotions managers|36300|91100 11-2021|Marketing managers|165240|113400 11-2022|Sales managers|322170|106790 11-2031|Public relations managers|47210|97170 11-3011|Administrative services managers|239360|76370
The problem is caused by the leading – comment in the script, and can be seen only when 'use <dbname>' is issued before the query:
[root@morhidi-572-sec-1 ~]# cat sample.sql
-- comment
use default;
select * from sample_07 limit 10;
[root@morhidi-572-sec-1 ~]#