Return-Path: X-Original-To: apmail-hive-dev-archive@www.apache.org Delivered-To: apmail-hive-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2B56611B24 for ; Mon, 22 Sep 2014 13:20:35 +0000 (UTC) Received: (qmail 58044 invoked by uid 500); 22 Sep 2014 13:20:34 -0000 Delivered-To: apmail-hive-dev-archive@hive.apache.org Received: (qmail 57966 invoked by uid 500); 22 Sep 2014 13:20:34 -0000 Mailing-List: contact dev-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@hive.apache.org Delivered-To: mailing list dev@hive.apache.org Received: (qmail 57952 invoked by uid 500); 22 Sep 2014 13:20:34 -0000 Delivered-To: apmail-hadoop-hive-dev@hadoop.apache.org Received: (qmail 57949 invoked by uid 99); 22 Sep 2014 13:20:34 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Sep 2014 13:20:34 +0000 Date: Mon, 22 Sep 2014 13:20:34 +0000 (UTC) From: "Naveen Gangam (JIRA)" To: hive-dev@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HIVE-7647) Beeline does not honor --headerInterval and --color when executing with "-e" MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HIVE-7647?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14143182#comment-14143182 ] Naveen Gangam commented on HIVE-7647: ------------------------------------- Thank you for committing this [~xuefuz] I have added a Release Note to this JIRA. However, I do not appear to be privileged enough to edit the wiki page mentioned above. Is that limited to committers only? Thanks > Beeline does not honor --headerInterval and --color when executing with "-e" > ---------------------------------------------------------------------------- > > Key: HIVE-7647 > URL: https://issues.apache.org/jira/browse/HIVE-7647 > Project: Hive > Issue Type: Bug > Components: CLI > Affects Versions: 0.14.0 > Reporter: Naveen Gangam > Assignee: Naveen Gangam > Priority: Minor > Labels: TODOC14 > Fix For: 0.14.0 > > Attachments: HIVE-7647.1.patch, HIVE-7647.2.patch > > > --showHeader is being honored > [root@localhost ~]# beeline --showHeader=false -u 'jdbc:hive2://localhost:10000/default' -n hive -d org.apache.hive.jdbc.HiveDriver -e "select * from sample_07 limit 10;" > Connecting to jdbc:hive2://localhost:10000/default > Connected to: Apache Hive (version 0.12.0-cdh5.0.1) > Driver: Hive JDBC (version 0.12.0-cdh5.0.1) > Transaction isolation: TRANSACTION_REPEATABLE_READ > -hiveconf (No such file or directory) > +----------+--------------------------------------+------------+---------+ > | 00-0000 | All Occupations | 135185230 | 42270 | > | 11-0000 | Management occupations | 6152650 | 100310 | > | 11-1011 | Chief executives | 301930 | 160440 | > | 11-1021 | General and operations managers | 1697690 | 107970 | > | 11-1031 | Legislators | 64650 | 37980 | > | 11-2011 | Advertising and promotions managers | 36100 | 94720 | > | 11-2021 | Marketing managers | 166790 | 118160 | > | 11-2022 | Sales managers | 333910 | 110390 | > | 11-2031 | Public relations managers | 51730 | 101220 | > | 11-3011 | Administrative services managers | 246930 | 79500 | > +----------+--------------------------------------+------------+---------+ > 10 rows selected (0.838 seconds) > Beeline version 0.12.0-cdh5.1.0 by Apache Hive > Closing: org.apache.hive.jdbc.HiveConnection > --outputFormat is being honored. > [root@localhost ~]# beeline --outputFormat=csv -u 'jdbc:hive2://localhost:10000/default' -n hive -d org.apache.hive.jdbc.HiveDriver -e "select * from sample_07 limit 10;" > Connecting to jdbc:hive2://localhost:10000/default > Connected to: Apache Hive (version 0.12.0-cdh5.0.1) > Driver: Hive JDBC (version 0.12.0-cdh5.0.1) > Transaction isolation: TRANSACTION_REPEATABLE_READ > 'code','description','total_emp','salary' > '00-0000','All Occupations','135185230','42270' > '11-0000','Management occupations','6152650','100310' > '11-1011','Chief executives','301930','160440' > '11-1021','General and operations managers','1697690','107970' > '11-1031','Legislators','64650','37980' > '11-2011','Advertising and promotions managers','36100','94720' > '11-2021','Marketing managers','166790','118160' > '11-2022','Sales managers','333910','110390' > '11-2031','Public relations managers','51730','101220' > '11-3011','Administrative services managers','246930','79500' > 10 rows selected (0.664 seconds) > Beeline version 0.12.0-cdh5.1.0 by Apache Hive > Closing: org.apache.hive.jdbc.HiveConnection > both --color & --headerInterval are being honored when executing using "-f" option (reads query from a file rather than the commandline) (cannot really see the color here but use the terminal colors) > [root@localhost ~]# beeline --showheader=true --color=true --headerInterval=5 -u 'jdbc:hive2://localhost:10000/default' -n hive -d org.apache.hive.jdbc.HiveDriver -f /tmp/tmp.sql > Connecting to jdbc:hive2://localhost:10000/default > Connected to: Apache Hive (version 0.12.0-cdh5.0.1) > Driver: Hive JDBC (version 0.12.0-cdh5.0.1) > Transaction isolation: TRANSACTION_REPEATABLE_READ > Beeline version 0.12.0-cdh5.1.0 by Apache Hive > 0: jdbc:hive2://localhost> select * from sample_07 limit 8; > +----------+--------------------------------------+------------+---------+ > | code | description | total_emp | salary | > +----------+--------------------------------------+------------+---------+ > | 00-0000 | All Occupations | 135185230 | 42270 | > | 11-0000 | Management occupations | 6152650 | 100310 | > | 11-1011 | Chief executives | 301930 | 160440 | > | 11-1021 | General and operations managers | 1697690 | 107970 | > | 11-1031 | Legislators | 64650 | 37980 | > +----------+--------------------------------------+------------+---------+ > | code | description | total_emp | salary | > +----------+--------------------------------------+------------+---------+ > | 11-2011 | Advertising and promotions managers | 36100 | 94720 | > | 11-2021 | Marketing managers | 166790 | 118160 | > | 11-2022 | Sales managers | 333910 | 110390 | > +----------+--------------------------------------+------------+---------+ > 8 rows selected (0.921 seconds) > 0: jdbc:hive2://localhost> Closing: org.apache.hive.jdbc.HiveConnection > But when running > beeline --showheader=true --color=true --headerInterval=5 -u 'jdbc:hive2://localhost:10000/default' -n hive -d org.apache.hive.jdbc.HiveDriver -e "select * from sample_07 limit 8;" > headerInterval & color are being overridden in the code. > From Beeline.java > if (commands.size() > 0) { > // for single command execute, disable colorgetOpts().setColor(false); > getOpts().setHeaderInterval(-1); > This overrides the default behavior. The documentation states that the default headerInterval is 100 for "table" output format. By default "table" output format is used with "-e" option but that headerInterval is being set to "-1" which results in header being printed after every row (since HIVE-7200). -- This message was sent by Atlassian JIRA (v6.3.4#6332)