You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@impala.apache.org by "Vincent Tran (JIRA)" <ji...@apache.org> on 2017/06/16 11:47:01 UTC

[jira] [Resolved] (IMPALA-4418) Extra blank lines in query result

     [ https://issues.apache.org/jira/browse/IMPALA-4418?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Vincent Tran resolved IMPALA-4418.
----------------------------------
    Resolution: Fixed

Author:     Vincent Tran <vt...@cloudera.com>
AuthorDate: 2017-06-02 01:12:22 -0400
Commit:     Impala Public Jenkins <im...@gerrit.cloudera.org>
CommitDate: 2017-06-16 09:33:40 +0000

IMPALA-4418: Fixes extra blank lines in query result

This change avoids printing blank lines when the Impala
shell fetches 0 rows from a statement.

Change-Id: I6e18ce36be07ee90a16b007b1e30d5255ef8a839
Reviewed-on: http://gerrit.cloudera.org:8080/7055
Reviewed-by: Alex Behm <al...@cloudera.com>
Tested-by: Impala Public Jenkins

> Extra blank lines in query result
> ---------------------------------
>
>                 Key: IMPALA-4418
>                 URL: https://issues.apache.org/jira/browse/IMPALA-4418
>             Project: IMPALA
>          Issue Type: Bug
>          Components: Clients
>    Affects Versions: Impala 2.5.0
>            Reporter: Matyas Orhidi
>            Assignee: Vincent Tran
>              Labels: newbie
>
> 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:
> {code}
> [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
> {code}
> The two extra blank lines can be seen before the query header:
> {code}
> [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
> {code}
> The problem is caused by the leading -- comment in the script, and can be seen only when 'use <dbname>' is issued before the query:
> {code}
> [root@morhidi-572-sec-1 ~]# cat sample.sql 
> -- comment
> use default;
> select * from sample_07 limit 10;
> [root@morhidi-572-sec-1 ~]# 
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)