You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by xu...@apache.org on 2014/06/16 19:43:58 UTC
svn commit: r1602937 -
/hive/trunk/beeline/src/java/org/apache/hive/beeline/TableOutputFormat.java
Author: xuefu
Date: Mon Jun 16 17:43:57 2014
New Revision: 1602937
URL: http://svn.apache.org/r1602937
Log:
HIVE-7200: Beeline output displays column heading even if --showHeader=false is set (Naveen Gangam via Xuefu)
Modified:
hive/trunk/beeline/src/java/org/apache/hive/beeline/TableOutputFormat.java
Modified: hive/trunk/beeline/src/java/org/apache/hive/beeline/TableOutputFormat.java
URL: http://svn.apache.org/viewvc/hive/trunk/beeline/src/java/org/apache/hive/beeline/TableOutputFormat.java?rev=1602937&r1=1602936&r2=1602937&view=diff
==============================================================================
--- hive/trunk/beeline/src/java/org/apache/hive/beeline/TableOutputFormat.java (original)
+++ hive/trunk/beeline/src/java/org/apache/hive/beeline/TableOutputFormat.java Mon Jun 16 17:43:57 2014
@@ -66,13 +66,16 @@ class TableOutputFormat implements Outpu
.truncate(headerCols.getVisibleLength());
}
- if (index == 0 ||
- (beeLine.getOpts().getHeaderInterval() > 0
- && index % beeLine.getOpts().getHeaderInterval() == 0
- && beeLine.getOpts().getShowHeader())) {
- printRow(header, true);
- printRow(headerCols, false);
- printRow(header, true);
+ if (beeLine.getOpts().getShowHeader()) {
+ if (index == 0 ||
+ (index - 1 > 0 && ((index - 1) % beeLine.getOpts().getHeaderInterval() == 0))
+ ) {
+ printRow(header, true);
+ printRow(headerCols, false);
+ printRow(header, true);
+ }
+ } else if (index == 0) {
+ printRow(header, true);
}
if (index != 0) {
@@ -81,7 +84,7 @@ class TableOutputFormat implements Outpu
index++;
}
- if (header != null && beeLine.getOpts().getShowHeader()) {
+ if (header != null) {
printRow(header, true);
}
@@ -137,4 +140,4 @@ class TableOutputFormat implements Outpu
}
return buf;
}
-}
\ No newline at end of file
+}