hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r1662780 - in /hive/trunk/beeline/src/java/org/apache/hive/beeline: DeprecatedSeparatedValuesOutputFormat.java SeparatedValuesOutputFormat.java
Date Fri, 27 Feb 2015 18:36:40 GMT
Author: brock
Date: Fri Feb 27 18:36:39 2015
New Revision: 1662780

URL: http://svn.apache.org/r1662780
Log:
HIVE-9770 - Beeline ignores --showHeader for non-tablular output formats i.e csv,tsv,dsv (Naveen
Gangam via Brock)

Modified:
    hive/trunk/beeline/src/java/org/apache/hive/beeline/DeprecatedSeparatedValuesOutputFormat.java
    hive/trunk/beeline/src/java/org/apache/hive/beeline/SeparatedValuesOutputFormat.java

Modified: hive/trunk/beeline/src/java/org/apache/hive/beeline/DeprecatedSeparatedValuesOutputFormat.java
URL: http://svn.apache.org/viewvc/hive/trunk/beeline/src/java/org/apache/hive/beeline/DeprecatedSeparatedValuesOutputFormat.java?rev=1662780&r1=1662779&r2=1662780&view=diff
==============================================================================
--- hive/trunk/beeline/src/java/org/apache/hive/beeline/DeprecatedSeparatedValuesOutputFormat.java
(original)
+++ hive/trunk/beeline/src/java/org/apache/hive/beeline/DeprecatedSeparatedValuesOutputFormat.java
Fri Feb 27 18:36:39 2015
@@ -45,6 +45,11 @@ class DeprecatedSeparatedValuesOutputFor
   public int print(Rows rows) {
     int count = 0;
     while (rows.hasNext()) {
+      if (count == 0 && !beeLine.getOpts().getShowHeader()) {
+        rows.next();
+        count++;
+        continue;
+      }
       printRow(rows, (Rows.Row) rows.next());
       count++;
     }

Modified: hive/trunk/beeline/src/java/org/apache/hive/beeline/SeparatedValuesOutputFormat.java
URL: http://svn.apache.org/viewvc/hive/trunk/beeline/src/java/org/apache/hive/beeline/SeparatedValuesOutputFormat.java?rev=1662780&r1=1662779&r2=1662780&view=diff
==============================================================================
--- hive/trunk/beeline/src/java/org/apache/hive/beeline/SeparatedValuesOutputFormat.java (original)
+++ hive/trunk/beeline/src/java/org/apache/hive/beeline/SeparatedValuesOutputFormat.java Fri
Feb 27 18:36:39 2015
@@ -64,6 +64,11 @@ class SeparatedValuesOutputFormat implem
 
     int count = 0;
     while (rows.hasNext()) {
+      if (count == 0 && !beeLine.getOpts().getShowHeader()) {
+        rows.next();
+        count++;
+        continue;
+      }
       printRow(rows, (Rows.Row) rows.next());
       count++;
     }



Mime
View raw message