You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by ha...@apache.org on 2014/04/08 21:16:00 UTC
svn commit: r1585820 -
/hive/branches/branch-0.13/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java
Author: hashutosh
Date: Tue Apr 8 19:15:59 2014
New Revision: 1585820
URL: http://svn.apache.org/r1585820
Log:
HIVE-6812 : show compactions returns error when there are no compactions (Alan Gates via Ashutosh Chauhan)
Modified:
hive/branches/branch-0.13/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java
Modified: hive/branches/branch-0.13/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java
URL: http://svn.apache.org/viewvc/hive/branches/branch-0.13/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java?rev=1585820&r1=1585819&r2=1585820&view=diff
==============================================================================
--- hive/branches/branch-0.13/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java (original)
+++ hive/branches/branch-0.13/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java Tue Apr 8 19:15:59 2014
@@ -2788,23 +2788,25 @@ public class DDLTask extends Task<DDLWor
os.writeBytes("Start Time");
os.write(terminator);
- for (ShowCompactResponseElement e : rsp.getCompacts()) {
- os.writeBytes(e.getDbname());
- os.write(separator);
- os.writeBytes(e.getTablename());
- os.write(separator);
- String part = e.getPartitionname();
- os.writeBytes(part == null ? "NULL" : part);
- os.write(separator);
- os.writeBytes(e.getType().toString());
- os.write(separator);
- os.writeBytes(e.getState());
- os.write(separator);
- String wid = e.getWorkerid();
- os.writeBytes(wid == null ? "NULL" : wid);
- os.write(separator);
- os.writeBytes(Long.toString(e.getStart()));
- os.write(terminator);
+ if (rsp.getCompacts() != null) {
+ for (ShowCompactResponseElement e : rsp.getCompacts()) {
+ os.writeBytes(e.getDbname());
+ os.write(separator);
+ os.writeBytes(e.getTablename());
+ os.write(separator);
+ String part = e.getPartitionname();
+ os.writeBytes(part == null ? "NULL" : part);
+ os.write(separator);
+ os.writeBytes(e.getType().toString());
+ os.write(separator);
+ os.writeBytes(e.getState());
+ os.write(separator);
+ String wid = e.getWorkerid();
+ os.writeBytes(wid == null ? "NULL" : wid);
+ os.write(separator);
+ os.writeBytes(Long.toString(e.getStart()));
+ os.write(terminator);
+ }
}
os.close();
} catch (IOException e) {