hadoop-hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nzh...@apache.org
Subject svn commit: r933422 - in /hadoop/hive/trunk: CHANGES.txt ql/src/java/org/apache/hadoop/hive/ql/processors/SetProcessor.java
Date Mon, 12 Apr 2010 21:26:54 GMT
Author: nzhang
Date: Mon Apr 12 21:26:54 2010
New Revision: 933422

URL: http://svn.apache.org/viewvc?rev=933422&view=rev
Log:
HIVE-1296. CLI set and set -v commands should dump properties in alphabetical order (John
Sichi via Ning Zhang)

Modified:
    hadoop/hive/trunk/CHANGES.txt
    hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/processors/SetProcessor.java

Modified: hadoop/hive/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/CHANGES.txt?rev=933422&r1=933421&r2=933422&view=diff
==============================================================================
--- hadoop/hive/trunk/CHANGES.txt (original)
+++ hadoop/hive/trunk/CHANGES.txt Mon Apr 12 21:26:54 2010
@@ -169,6 +169,9 @@ Trunk -  Unreleased
     HIVE-1276. Remove extra reducesink if it is already followed by a reduce sink
     (He Yongqiang via namit)
 
+    HIVE-1296. CLI set and set -v commands should dump properties in
+    alphabetical order (John Sichi via Ning Zhang)
+
   OPTIMIZATIONS
 
   BUG FIXES

Modified: hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/processors/SetProcessor.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/processors/SetProcessor.java?rev=933422&r1=933421&r2=933422&view=diff
==============================================================================
--- hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/processors/SetProcessor.java (original)
+++ hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/processors/SetProcessor.java Mon
Apr 12 21:26:54 2010
@@ -19,6 +19,9 @@
 package org.apache.hadoop.hive.ql.processors;
 
 import java.util.Properties;
+import java.util.Map;
+import java.util.SortedMap;
+import java.util.TreeMap;
 
 import org.apache.hadoop.hive.ql.session.SessionState;
 
@@ -44,11 +47,15 @@ public class SetProcessor implements Com
   private void dumpOptions(Properties p) {
     SessionState ss = SessionState.get();
 
-    ss.out.println("silent=" + (ss.getIsSilent() ? "on" : "off"));
+    SortedMap<String, String> sortedMap = new TreeMap<String, String>();
+    sortedMap.put("silent", (ss.getIsSilent() ? "on" : "off"));
     for (Object one : p.keySet()) {
       String oneProp = (String) one;
       String oneValue = p.getProperty(oneProp);
-      ss.out.println(oneProp + "=" + oneValue);
+      sortedMap.put(oneProp, oneValue);
+    }
+    for (Map.Entry<String, String> entries : sortedMap.entrySet()) {
+      ss.out.println(entries.getKey() + "=" + entries.getValue());
     }
   }
 



Mime
View raw message