hadoop-hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From athu...@apache.org
Subject svn commit: r738309 [1/2] - in /hadoop/hive/trunk: ./ ql/src/java/org/apache/hadoop/hive/ql/udf/ ql/src/test/queries/clientpositive/ ql/src/test/queries/positive/ ql/src/test/results/clientpositive/ ql/src/test/results/compiler/parse/ ql/src/test/resul...
Date Wed, 28 Jan 2009 00:05:32 GMT
Author: athusoo
Date: Wed Jan 28 00:05:30 2009
New Revision: 738309

URL: http://svn.apache.org/viewvc?rev=738309&view=rev
Log:
HIVE-179. Make substr behavior similar to other RDBMS.
(David Phillips via athusoo)


Added:
    hadoop/hive/trunk/ql/src/test/queries/clientpositive/udf_substr.q
    hadoop/hive/trunk/ql/src/test/results/clientpositive/udf_substr.q.out
Modified:
    hadoop/hive/trunk/CHANGES.txt
    hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/UDFSubstr.java
    hadoop/hive/trunk/ql/src/test/queries/clientpositive/groupby1.q
    hadoop/hive/trunk/ql/src/test/queries/clientpositive/groupby1_limit.q
    hadoop/hive/trunk/ql/src/test/queries/clientpositive/groupby1_map.q
    hadoop/hive/trunk/ql/src/test/queries/clientpositive/groupby2.q
    hadoop/hive/trunk/ql/src/test/queries/clientpositive/groupby2_limit.q
    hadoop/hive/trunk/ql/src/test/queries/clientpositive/groupby2_map.q
    hadoop/hive/trunk/ql/src/test/queries/clientpositive/groupby3.q
    hadoop/hive/trunk/ql/src/test/queries/clientpositive/groupby3_map.q
    hadoop/hive/trunk/ql/src/test/queries/clientpositive/groupby4.q
    hadoop/hive/trunk/ql/src/test/queries/clientpositive/groupby5.q
    hadoop/hive/trunk/ql/src/test/queries/clientpositive/groupby6.q
    hadoop/hive/trunk/ql/src/test/queries/clientpositive/groupby7.q
    hadoop/hive/trunk/ql/src/test/queries/clientpositive/groupby8.q
    hadoop/hive/trunk/ql/src/test/queries/positive/groupby1.q
    hadoop/hive/trunk/ql/src/test/queries/positive/groupby2.q
    hadoop/hive/trunk/ql/src/test/queries/positive/groupby3.q
    hadoop/hive/trunk/ql/src/test/queries/positive/groupby4.q
    hadoop/hive/trunk/ql/src/test/queries/positive/groupby5.q
    hadoop/hive/trunk/ql/src/test/queries/positive/groupby6.q
    hadoop/hive/trunk/ql/src/test/results/clientpositive/groupby1.q.out
    hadoop/hive/trunk/ql/src/test/results/clientpositive/groupby1_limit.q.out
    hadoop/hive/trunk/ql/src/test/results/clientpositive/groupby1_map.q.out
    hadoop/hive/trunk/ql/src/test/results/clientpositive/groupby2.q.out
    hadoop/hive/trunk/ql/src/test/results/clientpositive/groupby2_limit.q.out
    hadoop/hive/trunk/ql/src/test/results/clientpositive/groupby2_map.q.out
    hadoop/hive/trunk/ql/src/test/results/clientpositive/groupby3.q.out
    hadoop/hive/trunk/ql/src/test/results/clientpositive/groupby3_map.q.out
    hadoop/hive/trunk/ql/src/test/results/clientpositive/groupby4.q.out
    hadoop/hive/trunk/ql/src/test/results/clientpositive/groupby5.q.out
    hadoop/hive/trunk/ql/src/test/results/clientpositive/groupby6.q.out
    hadoop/hive/trunk/ql/src/test/results/compiler/parse/groupby1.q.out
    hadoop/hive/trunk/ql/src/test/results/compiler/parse/groupby2.q.out
    hadoop/hive/trunk/ql/src/test/results/compiler/parse/groupby3.q.out
    hadoop/hive/trunk/ql/src/test/results/compiler/parse/groupby4.q.out
    hadoop/hive/trunk/ql/src/test/results/compiler/parse/groupby5.q.out
    hadoop/hive/trunk/ql/src/test/results/compiler/parse/groupby6.q.out
    hadoop/hive/trunk/ql/src/test/results/compiler/plan/groupby1.q.xml
    hadoop/hive/trunk/ql/src/test/results/compiler/plan/groupby2.q.xml
    hadoop/hive/trunk/ql/src/test/results/compiler/plan/groupby3.q.xml
    hadoop/hive/trunk/ql/src/test/results/compiler/plan/groupby4.q.xml
    hadoop/hive/trunk/ql/src/test/results/compiler/plan/groupby5.q.xml
    hadoop/hive/trunk/ql/src/test/results/compiler/plan/groupby6.q.xml

Modified: hadoop/hive/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/CHANGES.txt?rev=738309&r1=738308&r2=738309&view=diff
==============================================================================
--- hadoop/hive/trunk/CHANGES.txt (original)
+++ hadoop/hive/trunk/CHANGES.txt Wed Jan 28 00:05:30 2009
@@ -243,3 +243,6 @@
 
     HIVE-248. Create file path names properly during the load command
     in case relative path names were specified. (Prasad Chakka via athusoo)
+
+    HIVE-179. Make substr behavior similar to other RDBMS.
+    (David Phillips via athusoo)

Modified: hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/UDFSubstr.java
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/UDFSubstr.java?rev=738309&r1=738308&r2=738309&view=diff
==============================================================================
--- hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/UDFSubstr.java (original)
+++ hadoop/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/udf/UDFSubstr.java Wed Jan 28 00:05:30 2009
@@ -26,15 +26,31 @@
   public UDFSubstr() {
   }
 
-  public String evaluate(String a, int start, int len)  {
-    if (start >= a.length()) return "";
-    if (start + len > a.length()) len = a.length() - start;
-    return a.substring(start, start + len);
+  public String evaluate(String s, Integer pos, Integer len)  {
+    int start, end;
+
+    if ((s == null) || (pos == null) || (len == null))
+      return null;
+    if ((len <= 0) || (Math.abs(pos) > s.length()))
+      return "";
+
+    if (pos > 0)
+      start = pos - 1;
+    else if (pos < 0)
+      start = s.length() + pos;
+    else
+      start = 0;
+
+    if ((s.length() - start) < len)
+      end = s.length();
+    else
+      end = start + len;
+
+    return s.substring(start, end);
   }
-  
-  public String evaluate(String a, int start)  {
-    if (start >= a.length()) return "";
-    return a.substring(start);
+
+  public String evaluate(String s, Integer pos)  {
+    return evaluate(s, pos, Integer.MAX_VALUE);
   }
 
 }

Modified: hadoop/hive/trunk/ql/src/test/queries/clientpositive/groupby1.q
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/test/queries/clientpositive/groupby1.q?rev=738309&r1=738308&r2=738309&view=diff
==============================================================================
--- hadoop/hive/trunk/ql/src/test/queries/clientpositive/groupby1.q (original)
+++ hadoop/hive/trunk/ql/src/test/queries/clientpositive/groupby1.q Wed Jan 28 00:05:30 2009
@@ -1,8 +1,8 @@
 CREATE TABLE dest_g1(key INT, value DOUBLE) STORED AS TEXTFILE;
 
 EXPLAIN
-FROM src INSERT OVERWRITE TABLE dest_g1 SELECT src.key, sum(substr(src.value,4)) GROUP BY src.key;
+FROM src INSERT OVERWRITE TABLE dest_g1 SELECT src.key, sum(substr(src.value,5)) GROUP BY src.key;
 
-FROM src INSERT OVERWRITE TABLE dest_g1 SELECT src.key, sum(substr(src.value,4)) GROUP BY src.key;
+FROM src INSERT OVERWRITE TABLE dest_g1 SELECT src.key, sum(substr(src.value,5)) GROUP BY src.key;
 
 SELECT dest_g1.* FROM dest_g1;

Modified: hadoop/hive/trunk/ql/src/test/queries/clientpositive/groupby1_limit.q
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/test/queries/clientpositive/groupby1_limit.q?rev=738309&r1=738308&r2=738309&view=diff
==============================================================================
--- hadoop/hive/trunk/ql/src/test/queries/clientpositive/groupby1_limit.q (original)
+++ hadoop/hive/trunk/ql/src/test/queries/clientpositive/groupby1_limit.q Wed Jan 28 00:05:30 2009
@@ -3,8 +3,8 @@
 CREATE TABLE dest1(key INT, value DOUBLE) STORED AS TEXTFILE;
 
 EXPLAIN
-FROM src INSERT OVERWRITE TABLE dest1 SELECT src.key, sum(substr(src.value,4)) GROUP BY src.key LIMIT 5;
+FROM src INSERT OVERWRITE TABLE dest1 SELECT src.key, sum(substr(src.value,5)) GROUP BY src.key LIMIT 5;
 
-FROM src INSERT OVERWRITE TABLE dest1 SELECT src.key, sum(substr(src.value,4)) GROUP BY src.key LIMIT 5;
+FROM src INSERT OVERWRITE TABLE dest1 SELECT src.key, sum(substr(src.value,5)) GROUP BY src.key LIMIT 5;
 
 SELECT dest1.* FROM dest1;

Modified: hadoop/hive/trunk/ql/src/test/queries/clientpositive/groupby1_map.q
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/test/queries/clientpositive/groupby1_map.q?rev=738309&r1=738308&r2=738309&view=diff
==============================================================================
--- hadoop/hive/trunk/ql/src/test/queries/clientpositive/groupby1_map.q (original)
+++ hadoop/hive/trunk/ql/src/test/queries/clientpositive/groupby1_map.q Wed Jan 28 00:05:30 2009
@@ -3,8 +3,8 @@
 CREATE TABLE dest1(key INT, value DOUBLE) STORED AS TEXTFILE;
 
 EXPLAIN
-FROM src INSERT OVERWRITE TABLE dest1 SELECT src.key, sum(substr(src.value,4)) GROUP BY src.key;
+FROM src INSERT OVERWRITE TABLE dest1 SELECT src.key, sum(substr(src.value,5)) GROUP BY src.key;
 
-FROM src INSERT OVERWRITE TABLE dest1 SELECT src.key, sum(substr(src.value,4)) GROUP BY src.key;
+FROM src INSERT OVERWRITE TABLE dest1 SELECT src.key, sum(substr(src.value,5)) GROUP BY src.key;
 
 SELECT dest1.* FROM dest1;

Modified: hadoop/hive/trunk/ql/src/test/queries/clientpositive/groupby2.q
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/test/queries/clientpositive/groupby2.q?rev=738309&r1=738308&r2=738309&view=diff
==============================================================================
--- hadoop/hive/trunk/ql/src/test/queries/clientpositive/groupby2.q (original)
+++ hadoop/hive/trunk/ql/src/test/queries/clientpositive/groupby2.q Wed Jan 28 00:05:30 2009
@@ -2,9 +2,9 @@
 
 EXPLAIN
 FROM src
-INSERT OVERWRITE TABLE dest_g2 SELECT substr(src.key,0,1), count(DISTINCT substr(src.value,4)), concat(substr(src.key,0,1),sum(substr(src.value,4))) GROUP BY substr(src.key,0,1);
+INSERT OVERWRITE TABLE dest_g2 SELECT substr(src.key,1,1), count(DISTINCT substr(src.value,5)), concat(substr(src.key,1,1),sum(substr(src.value,5))) GROUP BY substr(src.key,1,1);
 
 FROM src
-INSERT OVERWRITE TABLE dest_g2 SELECT substr(src.key,0,1), count(DISTINCT substr(src.value,4)), concat(substr(src.key,0,1),sum(substr(src.value,4))) GROUP BY substr(src.key,0,1);
+INSERT OVERWRITE TABLE dest_g2 SELECT substr(src.key,1,1), count(DISTINCT substr(src.value,5)), concat(substr(src.key,1,1),sum(substr(src.value,5))) GROUP BY substr(src.key,1,1);
 
 SELECT dest_g2.* FROM dest_g2;

Modified: hadoop/hive/trunk/ql/src/test/queries/clientpositive/groupby2_limit.q
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/test/queries/clientpositive/groupby2_limit.q?rev=738309&r1=738308&r2=738309&view=diff
==============================================================================
--- hadoop/hive/trunk/ql/src/test/queries/clientpositive/groupby2_limit.q (original)
+++ hadoop/hive/trunk/ql/src/test/queries/clientpositive/groupby2_limit.q Wed Jan 28 00:05:30 2009
@@ -1,7 +1,7 @@
 set mapred.reduce.tasks=31;
 
 EXPLAIN
-SELECT src.key, sum(substr(src.value,4)) FROM src GROUP BY src.key LIMIT 5;
+SELECT src.key, sum(substr(src.value,5)) FROM src GROUP BY src.key LIMIT 5;
 
-SELECT src.key, sum(substr(src.value,4)) FROM src GROUP BY src.key LIMIT 5;
+SELECT src.key, sum(substr(src.value,5)) FROM src GROUP BY src.key LIMIT 5;
 

Modified: hadoop/hive/trunk/ql/src/test/queries/clientpositive/groupby2_map.q
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/test/queries/clientpositive/groupby2_map.q?rev=738309&r1=738308&r2=738309&view=diff
==============================================================================
--- hadoop/hive/trunk/ql/src/test/queries/clientpositive/groupby2_map.q (original)
+++ hadoop/hive/trunk/ql/src/test/queries/clientpositive/groupby2_map.q Wed Jan 28 00:05:30 2009
@@ -4,9 +4,9 @@
 
 EXPLAIN
 FROM src
-INSERT OVERWRITE TABLE dest1 SELECT substr(src.key,0,1), count(DISTINCT substr(src.value,4)), concat(substr(src.key,0,1),sum(substr(src.value,4))) GROUP BY substr(src.key,0,1);
+INSERT OVERWRITE TABLE dest1 SELECT substr(src.key,1,1), count(DISTINCT substr(src.value,5)), concat(substr(src.key,1,1),sum(substr(src.value,5))) GROUP BY substr(src.key,1,1);
 
 FROM src
-INSERT OVERWRITE TABLE dest1 SELECT substr(src.key,0,1), count(DISTINCT substr(src.value,4)), concat(substr(src.key,0,1),sum(substr(src.value,4))) GROUP BY substr(src.key,0,1);
+INSERT OVERWRITE TABLE dest1 SELECT substr(src.key,1,1), count(DISTINCT substr(src.value,5)), concat(substr(src.key,1,1),sum(substr(src.value,5))) GROUP BY substr(src.key,1,1);
 
 SELECT dest1.* FROM dest1;

Modified: hadoop/hive/trunk/ql/src/test/queries/clientpositive/groupby3.q
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/test/queries/clientpositive/groupby3.q?rev=738309&r1=738308&r2=738309&view=diff
==============================================================================
--- hadoop/hive/trunk/ql/src/test/queries/clientpositive/groupby3.q (original)
+++ hadoop/hive/trunk/ql/src/test/queries/clientpositive/groupby3.q Wed Jan 28 00:05:30 2009
@@ -2,9 +2,9 @@
 
 EXPLAIN
 FROM src
-INSERT OVERWRITE TABLE dest1 SELECT sum(substr(src.value,4)), avg(substr(src.value,4)), avg(DISTINCT substr(src.value,4)), max(substr(src.value,4)), min(substr(src.value,4));
+INSERT OVERWRITE TABLE dest1 SELECT sum(substr(src.value,5)), avg(substr(src.value,5)), avg(DISTINCT substr(src.value,5)), max(substr(src.value,5)), min(substr(src.value,5));
 
 FROM src
-INSERT OVERWRITE TABLE dest1 SELECT sum(substr(src.value,4)), avg(substr(src.value,4)), avg(DISTINCT substr(src.value,4)), max(substr(src.value,4)), min(substr(src.value,4));
+INSERT OVERWRITE TABLE dest1 SELECT sum(substr(src.value,5)), avg(substr(src.value,5)), avg(DISTINCT substr(src.value,5)), max(substr(src.value,5)), min(substr(src.value,5));
 
 SELECT dest1.* FROM dest1;

Modified: hadoop/hive/trunk/ql/src/test/queries/clientpositive/groupby3_map.q
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/test/queries/clientpositive/groupby3_map.q?rev=738309&r1=738308&r2=738309&view=diff
==============================================================================
--- hadoop/hive/trunk/ql/src/test/queries/clientpositive/groupby3_map.q (original)
+++ hadoop/hive/trunk/ql/src/test/queries/clientpositive/groupby3_map.q Wed Jan 28 00:05:30 2009
@@ -4,9 +4,9 @@
 
 EXPLAIN
 FROM src
-INSERT OVERWRITE TABLE dest1 SELECT sum(substr(src.value,4)), avg(substr(src.value,4)), avg(DISTINCT substr(src.value,4)), max(substr(src.value,4)), min(substr(src.value,4));
+INSERT OVERWRITE TABLE dest1 SELECT sum(substr(src.value,5)), avg(substr(src.value,5)), avg(DISTINCT substr(src.value,5)), max(substr(src.value,5)), min(substr(src.value,5));
 
 FROM src
-INSERT OVERWRITE TABLE dest1 SELECT sum(substr(src.value,4)), avg(substr(src.value,4)), avg(DISTINCT substr(src.value,4)), max(substr(src.value,4)), min(substr(src.value,4));
+INSERT OVERWRITE TABLE dest1 SELECT sum(substr(src.value,5)), avg(substr(src.value,5)), avg(DISTINCT substr(src.value,5)), max(substr(src.value,5)), min(substr(src.value,5));
 
 SELECT dest1.* FROM dest1;

Modified: hadoop/hive/trunk/ql/src/test/queries/clientpositive/groupby4.q
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/test/queries/clientpositive/groupby4.q?rev=738309&r1=738308&r2=738309&view=diff
==============================================================================
--- hadoop/hive/trunk/ql/src/test/queries/clientpositive/groupby4.q (original)
+++ hadoop/hive/trunk/ql/src/test/queries/clientpositive/groupby4.q Wed Jan 28 00:05:30 2009
@@ -2,10 +2,10 @@
 
 EXPLAIN
 FROM src
-INSERT OVERWRITE TABLE dest1 SELECT substr(src.key,0,1) GROUP BY substr(src.key,0,1);
+INSERT OVERWRITE TABLE dest1 SELECT substr(src.key,1,1) GROUP BY substr(src.key,1,1);
 
 FROM src
-INSERT OVERWRITE TABLE dest1 SELECT substr(src.key,0,1) GROUP BY substr(src.key,0,1);
+INSERT OVERWRITE TABLE dest1 SELECT substr(src.key,1,1) GROUP BY substr(src.key,1,1);
 
 SELECT dest1.* FROM dest1;
 

Modified: hadoop/hive/trunk/ql/src/test/queries/clientpositive/groupby5.q
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/test/queries/clientpositive/groupby5.q?rev=738309&r1=738308&r2=738309&view=diff
==============================================================================
--- hadoop/hive/trunk/ql/src/test/queries/clientpositive/groupby5.q (original)
+++ hadoop/hive/trunk/ql/src/test/queries/clientpositive/groupby5.q Wed Jan 28 00:05:30 2009
@@ -2,12 +2,12 @@
 
 EXPLAIN
 INSERT OVERWRITE TABLE dest1 
-SELECT src.key, sum(substr(src.value,4)) 
+SELECT src.key, sum(substr(src.value,5)) 
 FROM src
 GROUP BY src.key;
 
 INSERT OVERWRITE TABLE dest1 
-SELECT src.key, sum(substr(src.value,4)) 
+SELECT src.key, sum(substr(src.value,5)) 
 FROM src
 GROUP BY src.key;
 

Modified: hadoop/hive/trunk/ql/src/test/queries/clientpositive/groupby6.q
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/test/queries/clientpositive/groupby6.q?rev=738309&r1=738308&r2=738309&view=diff
==============================================================================
--- hadoop/hive/trunk/ql/src/test/queries/clientpositive/groupby6.q (original)
+++ hadoop/hive/trunk/ql/src/test/queries/clientpositive/groupby6.q Wed Jan 28 00:05:30 2009
@@ -2,10 +2,10 @@
 
 EXPLAIN
 FROM src
-INSERT OVERWRITE TABLE dest1 SELECT DISTINCT substr(src.value,4,1);
+INSERT OVERWRITE TABLE dest1 SELECT DISTINCT substr(src.value,5,1);
 
 FROM src
-INSERT OVERWRITE TABLE dest1 SELECT DISTINCT substr(src.value,4,1);
+INSERT OVERWRITE TABLE dest1 SELECT DISTINCT substr(src.value,5,1);
 
 SELECT dest1.* FROM dest1;
 

Modified: hadoop/hive/trunk/ql/src/test/queries/clientpositive/groupby7.q
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/test/queries/clientpositive/groupby7.q?rev=738309&r1=738308&r2=738309&view=diff
==============================================================================
--- hadoop/hive/trunk/ql/src/test/queries/clientpositive/groupby7.q (original)
+++ hadoop/hive/trunk/ql/src/test/queries/clientpositive/groupby7.q Wed Jan 28 00:05:30 2009
@@ -5,8 +5,8 @@
 SET hive.exec.compress.output=true; 
 
 FROM SRC
-INSERT OVERWRITE TABLE DEST1 SELECT SRC.key, sum(SUBSTR(SRC.value,4)) GROUP BY SRC.key
-INSERT OVERWRITE TABLE DEST2 SELECT SRC.key, sum(SUBSTR(SRC.value,4)) GROUP BY SRC.key;
+INSERT OVERWRITE TABLE DEST1 SELECT SRC.key, sum(SUBSTR(SRC.value,5)) GROUP BY SRC.key
+INSERT OVERWRITE TABLE DEST2 SELECT SRC.key, sum(SUBSTR(SRC.value,5)) GROUP BY SRC.key;
 
 SELECT DEST1.* FROM DEST1;
 SELECT DEST2.* FROM DEST2;

Modified: hadoop/hive/trunk/ql/src/test/queries/clientpositive/groupby8.q
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/test/queries/clientpositive/groupby8.q?rev=738309&r1=738308&r2=738309&view=diff
==============================================================================
--- hadoop/hive/trunk/ql/src/test/queries/clientpositive/groupby8.q (original)
+++ hadoop/hive/trunk/ql/src/test/queries/clientpositive/groupby8.q Wed Jan 28 00:05:30 2009
@@ -2,8 +2,8 @@
 CREATE TABLE DEST2(key INT, value STRING) STORED AS TEXTFILE;
 
 FROM SRC
-INSERT OVERWRITE TABLE DEST1 SELECT SRC.key, COUNT(DISTINCT SUBSTR(SRC.value,4)) GROUP BY SRC.key
-INSERT OVERWRITE TABLE DEST2 SELECT SRC.key, COUNT(DISTINCT SUBSTR(SRC.value,4)) GROUP BY SRC.key;
+INSERT OVERWRITE TABLE DEST1 SELECT SRC.key, COUNT(DISTINCT SUBSTR(SRC.value,5)) GROUP BY SRC.key
+INSERT OVERWRITE TABLE DEST2 SELECT SRC.key, COUNT(DISTINCT SUBSTR(SRC.value,5)) GROUP BY SRC.key;
 
 SELECT DEST1.* FROM DEST1;
 SELECT DEST2.* FROM DEST2;

Added: hadoop/hive/trunk/ql/src/test/queries/clientpositive/udf_substr.q
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/test/queries/clientpositive/udf_substr.q?rev=738309&view=auto
==============================================================================
--- hadoop/hive/trunk/ql/src/test/queries/clientpositive/udf_substr.q (added)
+++ hadoop/hive/trunk/ql/src/test/queries/clientpositive/udf_substr.q Wed Jan 28 00:05:30 2009
@@ -0,0 +1,37 @@
+SELECT
+  substr(null, 1), substr(null, 1, 1),
+  substr('ABC', null), substr('ABC', null, 1),
+  substr('ABC', 1, null)
+FROM src LIMIT 1;
+
+SELECT
+  substr('ABC', 1, 0), substr('ABC', 1, -1), substr('ABC', 2, -100),
+  substr('ABC', 4), substr('ABC', 4, 100),
+  substr('ABC', -4), substr('ABC', -4, 100),
+  substr('ABC', 100), substr('ABC', 100, 100),
+  substr('ABC', -100), substr('ABC', -100, 100),
+  substr('ABC', 2147483647), substr('ABC', 2147483647, 2147483647)
+FROM src LIMIT 1;
+
+SELECT
+  substr('ABCDEFG', 3, 4), substr('ABCDEFG', -5, 4),
+  substr('ABCDEFG', 3), substr('ABCDEFG', -5),
+  substr('ABC', 0), substr('ABC', 1), substr('ABC', 2), substr('ABC', 3),
+  substr('ABC', 1, 2147483647), substr('ABC', 2, 2147483647),
+  substr('A', 0), substr('A', 1), substr('A', -1)
+FROM src LIMIT 1;
+
+SELECT
+  substr('ABC', 0, 1), substr('ABC', 0, 2), substr('ABC', 0, 3), substr('ABC', 0, 4),
+  substr('ABC', 1, 1), substr('ABC', 1, 2), substr('ABC', 1, 3), substr('ABC', 1, 4),
+  substr('ABC', 2, 1), substr('ABC', 2, 2), substr('ABC', 2, 3), substr('ABC', 2, 4),
+  substr('ABC', 3, 1), substr('ABC', 3, 2), substr('ABC', 3, 3), substr('ABC', 3, 4),
+  substr('ABC', 4, 1)
+FROM src LIMIT 1;
+
+SELECT
+  substr('ABC', -1, 1), substr('ABC', -1, 2), substr('ABC', -1, 3), substr('ABC', -1, 4),
+  substr('ABC', -2, 1), substr('ABC', -2, 2), substr('ABC', -2, 3), substr('ABC', -2, 4),
+  substr('ABC', -3, 1), substr('ABC', -3, 2), substr('ABC', -3, 3), substr('ABC', -3, 4),
+  substr('ABC', -4, 1)
+FROM src LIMIT 1;

Modified: hadoop/hive/trunk/ql/src/test/queries/positive/groupby1.q
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/test/queries/positive/groupby1.q?rev=738309&r1=738308&r2=738309&view=diff
==============================================================================
--- hadoop/hive/trunk/ql/src/test/queries/positive/groupby1.q (original)
+++ hadoop/hive/trunk/ql/src/test/queries/positive/groupby1.q Wed Jan 28 00:05:30 2009
@@ -1,2 +1,2 @@
 FROM src
-INSERT OVERWRITE TABLE dest1 SELECT src.key, sum(substr(src.value,4)) GROUP BY src.key
+INSERT OVERWRITE TABLE dest1 SELECT src.key, sum(substr(src.value,5)) GROUP BY src.key

Modified: hadoop/hive/trunk/ql/src/test/queries/positive/groupby2.q
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/test/queries/positive/groupby2.q?rev=738309&r1=738308&r2=738309&view=diff
==============================================================================
--- hadoop/hive/trunk/ql/src/test/queries/positive/groupby2.q (original)
+++ hadoop/hive/trunk/ql/src/test/queries/positive/groupby2.q Wed Jan 28 00:05:30 2009
@@ -1,2 +1,2 @@
 FROM src
-SELECT substr(src.key,0,1), count(DISTINCT substr(src.value,4)), concat(substr(src.key,0,1),sum(substr(src.value,4))) GROUP BY substr(src.key,0,1)
+SELECT substr(src.key,1,1), count(DISTINCT substr(src.value,5)), concat(substr(src.key,1,1),sum(substr(src.value,5))) GROUP BY substr(src.key,1,1)

Modified: hadoop/hive/trunk/ql/src/test/queries/positive/groupby3.q
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/test/queries/positive/groupby3.q?rev=738309&r1=738308&r2=738309&view=diff
==============================================================================
--- hadoop/hive/trunk/ql/src/test/queries/positive/groupby3.q (original)
+++ hadoop/hive/trunk/ql/src/test/queries/positive/groupby3.q Wed Jan 28 00:05:30 2009
@@ -1,2 +1,2 @@
 FROM src
-SELECT sum(substr(src.value,4)), avg(substr(src.value,4)), avg(DISTINCT substr(src.value,4)), max(substr(src.value,4)), min(substr(src.value,4))
+SELECT sum(substr(src.value,5)), avg(substr(src.value,5)), avg(DISTINCT substr(src.value,5)), max(substr(src.value,5)), min(substr(src.value,5))

Modified: hadoop/hive/trunk/ql/src/test/queries/positive/groupby4.q
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/test/queries/positive/groupby4.q?rev=738309&r1=738308&r2=738309&view=diff
==============================================================================
--- hadoop/hive/trunk/ql/src/test/queries/positive/groupby4.q (original)
+++ hadoop/hive/trunk/ql/src/test/queries/positive/groupby4.q Wed Jan 28 00:05:30 2009
@@ -1,2 +1,2 @@
 FROM src
-SELECT substr(src.key,0,1) GROUP BY substr(src.key,0,1)
+SELECT substr(src.key,1,1) GROUP BY substr(src.key,1,1)

Modified: hadoop/hive/trunk/ql/src/test/queries/positive/groupby5.q
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/test/queries/positive/groupby5.q?rev=738309&r1=738308&r2=738309&view=diff
==============================================================================
--- hadoop/hive/trunk/ql/src/test/queries/positive/groupby5.q (original)
+++ hadoop/hive/trunk/ql/src/test/queries/positive/groupby5.q Wed Jan 28 00:05:30 2009
@@ -1,4 +1,4 @@
 
-SELECT src.key, sum(substr(src.value,4)) 
+SELECT src.key, sum(substr(src.value,5)) 
 FROM src
 GROUP BY src.key

Modified: hadoop/hive/trunk/ql/src/test/queries/positive/groupby6.q
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/test/queries/positive/groupby6.q?rev=738309&r1=738308&r2=738309&view=diff
==============================================================================
--- hadoop/hive/trunk/ql/src/test/queries/positive/groupby6.q (original)
+++ hadoop/hive/trunk/ql/src/test/queries/positive/groupby6.q Wed Jan 28 00:05:30 2009
@@ -1,2 +1,2 @@
 FROM src
-SELECT DISTINCT substr(src.value,4,1)
+SELECT DISTINCT substr(src.value,5,1)

Modified: hadoop/hive/trunk/ql/src/test/results/clientpositive/groupby1.q.out
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/test/results/clientpositive/groupby1.q.out?rev=738309&r1=738308&r2=738309&view=diff
==============================================================================
--- hadoop/hive/trunk/ql/src/test/results/clientpositive/groupby1.q.out (original)
+++ hadoop/hive/trunk/ql/src/test/results/clientpositive/groupby1.q.out Wed Jan 28 00:05:30 2009
@@ -1,5 +1,5 @@
 ABSTRACT SYNTAX TREE:
-  (TOK_QUERY (TOK_FROM (TOK_TABREF src)) (TOK_INSERT (TOK_DESTINATION (TOK_TAB dest_g1)) (TOK_SELECT (TOK_SELEXPR (TOK_COLREF src key)) (TOK_SELEXPR (TOK_FUNCTION sum (TOK_FUNCTION substr (TOK_COLREF src value) 4)))) (TOK_GROUPBY (TOK_COLREF src key))))
+  (TOK_QUERY (TOK_FROM (TOK_TABREF src)) (TOK_INSERT (TOK_DESTINATION (TOK_TAB dest_g1)) (TOK_SELECT (TOK_SELEXPR (TOK_COLREF src key)) (TOK_SELEXPR (TOK_FUNCTION sum (TOK_FUNCTION substr (TOK_COLREF src value) 5)))) (TOK_GROUPBY (TOK_COLREF src key))))
 
 STAGE DEPENDENCIES:
   Stage-1 is a root stage
@@ -21,7 +21,7 @@
                     type: double
               tag: -1
               value expressions:
-                    expr: substr(value, 4)
+                    expr: substr(value, 5)
                     type: string
       Reduce Operator Tree:
         Group By Operator

Modified: hadoop/hive/trunk/ql/src/test/results/clientpositive/groupby1_limit.q.out
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/test/results/clientpositive/groupby1_limit.q.out?rev=738309&r1=738308&r2=738309&view=diff
==============================================================================
--- hadoop/hive/trunk/ql/src/test/results/clientpositive/groupby1_limit.q.out (original)
+++ hadoop/hive/trunk/ql/src/test/results/clientpositive/groupby1_limit.q.out Wed Jan 28 00:05:30 2009
@@ -1,5 +1,5 @@
 ABSTRACT SYNTAX TREE:
-  (TOK_QUERY (TOK_FROM (TOK_TABREF src)) (TOK_INSERT (TOK_DESTINATION (TOK_TAB dest1)) (TOK_SELECT (TOK_SELEXPR (TOK_COLREF src key)) (TOK_SELEXPR (TOK_FUNCTION sum (TOK_FUNCTION substr (TOK_COLREF src value) 4)))) (TOK_GROUPBY (TOK_COLREF src key)) (TOK_LIMIT 5)))
+  (TOK_QUERY (TOK_FROM (TOK_TABREF src)) (TOK_INSERT (TOK_DESTINATION (TOK_TAB dest1)) (TOK_SELECT (TOK_SELEXPR (TOK_COLREF src key)) (TOK_SELEXPR (TOK_FUNCTION sum (TOK_FUNCTION substr (TOK_COLREF src value) 5)))) (TOK_GROUPBY (TOK_COLREF src key)) (TOK_LIMIT 5)))
 
 STAGE DEPENDENCIES:
   Stage-1 is a root stage
@@ -22,7 +22,7 @@
                     type: double
               tag: -1
               value expressions:
-                    expr: substr(value, 4)
+                    expr: substr(value, 5)
                     type: string
       Reduce Operator Tree:
         Group By Operator

Modified: hadoop/hive/trunk/ql/src/test/results/clientpositive/groupby1_map.q.out
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/test/results/clientpositive/groupby1_map.q.out?rev=738309&r1=738308&r2=738309&view=diff
==============================================================================
--- hadoop/hive/trunk/ql/src/test/results/clientpositive/groupby1_map.q.out (original)
+++ hadoop/hive/trunk/ql/src/test/results/clientpositive/groupby1_map.q.out Wed Jan 28 00:05:30 2009
@@ -1,5 +1,5 @@
 ABSTRACT SYNTAX TREE:
-  (TOK_QUERY (TOK_FROM (TOK_TABREF src)) (TOK_INSERT (TOK_DESTINATION (TOK_TAB dest1)) (TOK_SELECT (TOK_SELEXPR (TOK_COLREF src key)) (TOK_SELEXPR (TOK_FUNCTION sum (TOK_FUNCTION substr (TOK_COLREF src value) 4)))) (TOK_GROUPBY (TOK_COLREF src key))))
+  (TOK_QUERY (TOK_FROM (TOK_TABREF src)) (TOK_INSERT (TOK_DESTINATION (TOK_TAB dest1)) (TOK_SELECT (TOK_SELEXPR (TOK_COLREF src key)) (TOK_SELEXPR (TOK_FUNCTION sum (TOK_FUNCTION substr (TOK_COLREF src value) 5)))) (TOK_GROUPBY (TOK_COLREF src key))))
 
 STAGE DEPENDENCIES:
   Stage-1 is a root stage
@@ -13,7 +13,7 @@
         src 
             Group By Operator
               aggregations:
-                    expr: sum(UDFToDouble(substr(value, 4)))
+                    expr: sum(UDFToDouble(substr(value, 5)))
               keys:
                     expr: key
                     type: string

Modified: hadoop/hive/trunk/ql/src/test/results/clientpositive/groupby2.q.out
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/test/results/clientpositive/groupby2.q.out?rev=738309&r1=738308&r2=738309&view=diff
==============================================================================
--- hadoop/hive/trunk/ql/src/test/results/clientpositive/groupby2.q.out (original)
+++ hadoop/hive/trunk/ql/src/test/results/clientpositive/groupby2.q.out Wed Jan 28 00:05:30 2009
@@ -1,5 +1,5 @@
 ABSTRACT SYNTAX TREE:
-  (TOK_QUERY (TOK_FROM (TOK_TABREF src)) (TOK_INSERT (TOK_DESTINATION (TOK_TAB dest_g2)) (TOK_SELECT (TOK_SELEXPR (TOK_FUNCTION substr (TOK_COLREF src key) 0 1)) (TOK_SELEXPR (TOK_FUNCTIONDI count (TOK_FUNCTION substr (TOK_COLREF src value) 4))) (TOK_SELEXPR (TOK_FUNCTION concat (TOK_FUNCTION substr (TOK_COLREF src key) 0 1) (TOK_FUNCTION sum (TOK_FUNCTION substr (TOK_COLREF src value) 4))))) (TOK_GROUPBY (TOK_FUNCTION substr (TOK_COLREF src key) 0 1))))
+  (TOK_QUERY (TOK_FROM (TOK_TABREF src)) (TOK_INSERT (TOK_DESTINATION (TOK_TAB dest_g2)) (TOK_SELECT (TOK_SELEXPR (TOK_FUNCTION substr (TOK_COLREF src key) 1 1)) (TOK_SELEXPR (TOK_FUNCTIONDI count (TOK_FUNCTION substr (TOK_COLREF src value) 5))) (TOK_SELEXPR (TOK_FUNCTION concat (TOK_FUNCTION substr (TOK_COLREF src key) 1 1) (TOK_FUNCTION sum (TOK_FUNCTION substr (TOK_COLREF src value) 5))))) (TOK_GROUPBY (TOK_FUNCTION substr (TOK_COLREF src key) 1 1))))
 
 STAGE DEPENDENCIES:
   Stage-1 is a root stage
@@ -13,22 +13,22 @@
         src 
             Reduce Output Operator
               key expressions:
-                    expr: substr(key, 0, 1)
+                    expr: substr(key, 1, 1)
                     type: string
-                    expr: substr(value, 4)
+                    expr: substr(value, 5)
                     type: string
               sort order: ++
               Map-reduce partition columns:
-                    expr: substr(key, 0, 1)
+                    expr: substr(key, 1, 1)
                     type: string
-                    expr: substr(value, 4)
+                    expr: substr(value, 5)
                     type: string
               tag: -1
       Reduce Operator Tree:
         Group By Operator
           aggregations:
-                expr: count(DISTINCT KEY.1)
                 expr: sum(UDFToDouble(KEY.1))
+                expr: count(DISTINCT KEY.1)
           keys:
                 expr: KEY.0
                 type: string
@@ -55,14 +55,14 @@
             tag: -1
             value expressions:
                   expr: 1
-                  type: bigint
-                  expr: 2
                   type: double
+                  expr: 2
+                  type: bigint
       Reduce Operator Tree:
         Group By Operator
           aggregations:
-                expr: count(VALUE.0)
-                expr: sum(VALUE.1)
+                expr: sum(VALUE.0)
+                expr: count(VALUE.1)
           keys:
                 expr: KEY.0
                 type: string
@@ -71,9 +71,9 @@
             expressions:
                   expr: 0
                   type: string
-                  expr: 1
+                  expr: 2
                   type: bigint
-                  expr: concat(0, UDFToString(2))
+                  expr: concat(0, UDFToString(1))
                   type: string
             Select Operator
               expressions:

Modified: hadoop/hive/trunk/ql/src/test/results/clientpositive/groupby2_limit.q.out
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/test/results/clientpositive/groupby2_limit.q.out?rev=738309&r1=738308&r2=738309&view=diff
==============================================================================
--- hadoop/hive/trunk/ql/src/test/results/clientpositive/groupby2_limit.q.out (original)
+++ hadoop/hive/trunk/ql/src/test/results/clientpositive/groupby2_limit.q.out Wed Jan 28 00:05:30 2009
@@ -1,5 +1,5 @@
 ABSTRACT SYNTAX TREE:
-  (TOK_QUERY (TOK_FROM (TOK_TABREF src)) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (TOK_COLREF src key)) (TOK_SELEXPR (TOK_FUNCTION sum (TOK_FUNCTION substr (TOK_COLREF src value) 4)))) (TOK_GROUPBY (TOK_COLREF src key)) (TOK_LIMIT 5)))
+  (TOK_QUERY (TOK_FROM (TOK_TABREF src)) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (TOK_COLREF src key)) (TOK_SELEXPR (TOK_FUNCTION sum (TOK_FUNCTION substr (TOK_COLREF src value) 5)))) (TOK_GROUPBY (TOK_COLREF src key)) (TOK_LIMIT 5)))
 
 STAGE DEPENDENCIES:
   Stage-1 is a root stage
@@ -21,7 +21,7 @@
                     type: double
               tag: -1
               value expressions:
-                    expr: substr(value, 4)
+                    expr: substr(value, 5)
                     type: string
       Reduce Operator Tree:
         Group By Operator

Modified: hadoop/hive/trunk/ql/src/test/results/clientpositive/groupby2_map.q.out
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/test/results/clientpositive/groupby2_map.q.out?rev=738309&r1=738308&r2=738309&view=diff
==============================================================================
--- hadoop/hive/trunk/ql/src/test/results/clientpositive/groupby2_map.q.out (original)
+++ hadoop/hive/trunk/ql/src/test/results/clientpositive/groupby2_map.q.out Wed Jan 28 00:05:30 2009
@@ -1,5 +1,5 @@
 ABSTRACT SYNTAX TREE:
-  (TOK_QUERY (TOK_FROM (TOK_TABREF src)) (TOK_INSERT (TOK_DESTINATION (TOK_TAB dest1)) (TOK_SELECT (TOK_SELEXPR (TOK_FUNCTION substr (TOK_COLREF src key) 0 1)) (TOK_SELEXPR (TOK_FUNCTIONDI count (TOK_FUNCTION substr (TOK_COLREF src value) 4))) (TOK_SELEXPR (TOK_FUNCTION concat (TOK_FUNCTION substr (TOK_COLREF src key) 0 1) (TOK_FUNCTION sum (TOK_FUNCTION substr (TOK_COLREF src value) 4))))) (TOK_GROUPBY (TOK_FUNCTION substr (TOK_COLREF src key) 0 1))))
+  (TOK_QUERY (TOK_FROM (TOK_TABREF src)) (TOK_INSERT (TOK_DESTINATION (TOK_TAB dest1)) (TOK_SELECT (TOK_SELEXPR (TOK_FUNCTION substr (TOK_COLREF src key) 1 1)) (TOK_SELEXPR (TOK_FUNCTIONDI count (TOK_FUNCTION substr (TOK_COLREF src value) 5))) (TOK_SELEXPR (TOK_FUNCTION concat (TOK_FUNCTION substr (TOK_COLREF src key) 1 1) (TOK_FUNCTION sum (TOK_FUNCTION substr (TOK_COLREF src value) 5))))) (TOK_GROUPBY (TOK_FUNCTION substr (TOK_COLREF src key) 1 1))))
 
 STAGE DEPENDENCIES:
   Stage-1 is a root stage
@@ -13,12 +13,12 @@
         src 
             Group By Operator
               aggregations:
-                    expr: count(DISTINCT substr(value, 4))
-                    expr: sum(UDFToDouble(substr(value, 4)))
+                    expr: sum(UDFToDouble(substr(value, 5)))
+                    expr: count(DISTINCT substr(value, 5))
               keys:
-                    expr: substr(key, 0, 1)
+                    expr: substr(key, 1, 1)
                     type: string
-                    expr: substr(value, 4)
+                    expr: substr(value, 5)
                     type: string
               mode: hash
               Reduce Output Operator
@@ -36,14 +36,14 @@
                 tag: -1
                 value expressions:
                       expr: 2
-                      type: bigint
-                      expr: 3
                       type: double
+                      expr: 3
+                      type: bigint
       Reduce Operator Tree:
         Group By Operator
           aggregations:
+                expr: sum(VALUE.0)
                 expr: count(DISTINCT KEY.1)
-                expr: sum(VALUE.1)
           keys:
                 expr: KEY.0
                 type: string
@@ -58,7 +58,7 @@
   Stage: Stage-2
     Map Reduce
       Alias -> Map Operator Tree:
-        /tmp/hive-zshao/107370008/1090440963.10001 
+        /data/users/athusoo/commits/hive_trunk_ws3/build/ql/tmp/435212851/489689211.10001 
           Reduce Output Operator
             key expressions:
                   expr: 0
@@ -70,14 +70,14 @@
             tag: -1
             value expressions:
                   expr: 1
-                  type: bigint
-                  expr: 2
                   type: double
+                  expr: 2
+                  type: bigint
       Reduce Operator Tree:
         Group By Operator
           aggregations:
-                expr: count(VALUE.0)
-                expr: sum(VALUE.1)
+                expr: sum(VALUE.0)
+                expr: count(VALUE.1)
           keys:
                 expr: KEY.0
                 type: string
@@ -86,9 +86,9 @@
             expressions:
                   expr: 0
                   type: string
-                  expr: 1
+                  expr: 2
                   type: bigint
-                  expr: concat(0, UDFToString(2))
+                  expr: concat(0, UDFToString(1))
                   type: string
             Select Operator
               expressions:

Modified: hadoop/hive/trunk/ql/src/test/results/clientpositive/groupby3.q.out
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/test/results/clientpositive/groupby3.q.out?rev=738309&r1=738308&r2=738309&view=diff
==============================================================================
--- hadoop/hive/trunk/ql/src/test/results/clientpositive/groupby3.q.out (original)
+++ hadoop/hive/trunk/ql/src/test/results/clientpositive/groupby3.q.out Wed Jan 28 00:05:30 2009
@@ -1,5 +1,5 @@
 ABSTRACT SYNTAX TREE:
-  (TOK_QUERY (TOK_FROM (TOK_TABREF src)) (TOK_INSERT (TOK_DESTINATION (TOK_TAB dest1)) (TOK_SELECT (TOK_SELEXPR (TOK_FUNCTION sum (TOK_FUNCTION substr (TOK_COLREF src value) 4))) (TOK_SELEXPR (TOK_FUNCTION avg (TOK_FUNCTION substr (TOK_COLREF src value) 4))) (TOK_SELEXPR (TOK_FUNCTIONDI avg (TOK_FUNCTION substr (TOK_COLREF src value) 4))) (TOK_SELEXPR (TOK_FUNCTION max (TOK_FUNCTION substr (TOK_COLREF src value) 4))) (TOK_SELEXPR (TOK_FUNCTION min (TOK_FUNCTION substr (TOK_COLREF src value) 4))))))
+  (TOK_QUERY (TOK_FROM (TOK_TABREF src)) (TOK_INSERT (TOK_DESTINATION (TOK_TAB dest1)) (TOK_SELECT (TOK_SELEXPR (TOK_FUNCTION sum (TOK_FUNCTION substr (TOK_COLREF src value) 5))) (TOK_SELEXPR (TOK_FUNCTION avg (TOK_FUNCTION substr (TOK_COLREF src value) 5))) (TOK_SELEXPR (TOK_FUNCTIONDI avg (TOK_FUNCTION substr (TOK_COLREF src value) 5))) (TOK_SELEXPR (TOK_FUNCTION max (TOK_FUNCTION substr (TOK_COLREF src value) 5))) (TOK_SELEXPR (TOK_FUNCTION min (TOK_FUNCTION substr (TOK_COLREF src value) 5))))))
 
 STAGE DEPENDENCIES:
   Stage-1 is a root stage
@@ -17,21 +17,21 @@
                     type: string
               Reduce Output Operator
                 key expressions:
-                      expr: substr(0, 4)
+                      expr: substr(0, 5)
                       type: string
                 sort order: +
                 Map-reduce partition columns:
-                      expr: substr(0, 4)
+                      expr: substr(0, 5)
                       type: string
                 tag: -1
       Reduce Operator Tree:
         Group By Operator
           aggregations:
-                expr: avg(DISTINCT UDFToDouble(KEY.0))
                 expr: sum(UDFToDouble(KEY.0))
-                expr: avg(UDFToDouble(KEY.0))
-                expr: min(KEY.0)
                 expr: max(KEY.0)
+                expr: avg(DISTINCT UDFToDouble(KEY.0))
+                expr: min(KEY.0)
+                expr: avg(UDFToDouble(KEY.0))
           mode: partial1
           File Output Operator
             compressed: false
@@ -43,15 +43,15 @@
   Stage: Stage-2
     Map Reduce
       Alias -> Map Operator Tree:
-        /data/users/athusoo/apacheprojects/hive_local_ws3/build/ql/tmp/191882138/597396542.10001 
+        /data/users/athusoo/commits/hive_trunk_ws3/build/ql/tmp/1302296/900109453.10001 
           Reduce Output Operator
             sort order: 
             tag: -1
             value expressions:
                   expr: 0
-                  type: string
-                  expr: 1
                   type: double
+                  expr: 1
+                  type: string
                   expr: 2
                   type: string
                   expr: 3
@@ -61,21 +61,21 @@
       Reduce Operator Tree:
         Group By Operator
           aggregations:
-                expr: avg(UDFToDouble(VALUE.0))
-                expr: sum(VALUE.1)
+                expr: sum(VALUE.0)
+                expr: max(VALUE.1)
                 expr: avg(UDFToDouble(VALUE.2))
                 expr: min(VALUE.3)
-                expr: max(VALUE.4)
+                expr: avg(UDFToDouble(VALUE.4))
           mode: final
           Select Operator
             expressions:
-                  expr: 1
-                  type: double
-                  expr: 2
-                  type: double
                   expr: 0
                   type: double
                   expr: 4
+                  type: double
+                  expr: 2
+                  type: double
+                  expr: 1
                   type: string
                   expr: 3
                   type: string

Modified: hadoop/hive/trunk/ql/src/test/results/clientpositive/groupby3_map.q.out
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/test/results/clientpositive/groupby3_map.q.out?rev=738309&r1=738308&r2=738309&view=diff
==============================================================================
--- hadoop/hive/trunk/ql/src/test/results/clientpositive/groupby3_map.q.out (original)
+++ hadoop/hive/trunk/ql/src/test/results/clientpositive/groupby3_map.q.out Wed Jan 28 00:05:30 2009
@@ -1,5 +1,5 @@
 ABSTRACT SYNTAX TREE:
-  (TOK_QUERY (TOK_FROM (TOK_TABREF src)) (TOK_INSERT (TOK_DESTINATION (TOK_TAB dest1)) (TOK_SELECT (TOK_SELEXPR (TOK_FUNCTION sum (TOK_FUNCTION substr (TOK_COLREF src value) 4))) (TOK_SELEXPR (TOK_FUNCTION avg (TOK_FUNCTION substr (TOK_COLREF src value) 4))) (TOK_SELEXPR (TOK_FUNCTIONDI avg (TOK_FUNCTION substr (TOK_COLREF src value) 4))) (TOK_SELEXPR (TOK_FUNCTION max (TOK_FUNCTION substr (TOK_COLREF src value) 4))) (TOK_SELEXPR (TOK_FUNCTION min (TOK_FUNCTION substr (TOK_COLREF src value) 4))))))
+  (TOK_QUERY (TOK_FROM (TOK_TABREF src)) (TOK_INSERT (TOK_DESTINATION (TOK_TAB dest1)) (TOK_SELECT (TOK_SELEXPR (TOK_FUNCTION sum (TOK_FUNCTION substr (TOK_COLREF src value) 5))) (TOK_SELEXPR (TOK_FUNCTION avg (TOK_FUNCTION substr (TOK_COLREF src value) 5))) (TOK_SELEXPR (TOK_FUNCTIONDI avg (TOK_FUNCTION substr (TOK_COLREF src value) 5))) (TOK_SELEXPR (TOK_FUNCTION max (TOK_FUNCTION substr (TOK_COLREF src value) 5))) (TOK_SELEXPR (TOK_FUNCTION min (TOK_FUNCTION substr (TOK_COLREF src value) 5))))))
 
 STAGE DEPENDENCIES:
   Stage-1 is a root stage
@@ -17,13 +17,13 @@
                     type: string
               Group By Operator
                 aggregations:
-                      expr: avg(DISTINCT UDFToDouble(substr(0, 4)))
-                      expr: sum(UDFToDouble(substr(0, 4)))
-                      expr: avg(UDFToDouble(substr(0, 4)))
-                      expr: min(substr(0, 4))
-                      expr: max(substr(0, 4))
+                      expr: sum(UDFToDouble(substr(0, 5)))
+                      expr: max(substr(0, 5))
+                      expr: avg(DISTINCT UDFToDouble(substr(0, 5)))
+                      expr: min(substr(0, 5))
+                      expr: avg(UDFToDouble(substr(0, 5)))
                 keys:
-                      expr: substr(0, 4)
+                      expr: substr(0, 5)
                       type: string
                 mode: hash
                 Reduce Output Operator
@@ -37,9 +37,9 @@
                   tag: -1
                   value expressions:
                         expr: 1
-                        type: string
-                        expr: 2
                         type: double
+                        expr: 2
+                        type: string
                         expr: 3
                         type: string
                         expr: 4
@@ -49,11 +49,11 @@
       Reduce Operator Tree:
         Group By Operator
           aggregations:
+                expr: sum(VALUE.0)
+                expr: max(VALUE.1)
                 expr: avg(DISTINCT UDFToDouble(KEY.0))
-                expr: sum(VALUE.1)
-                expr: avg(UDFToDouble(VALUE.2))
                 expr: min(VALUE.3)
-                expr: max(VALUE.4)
+                expr: avg(UDFToDouble(VALUE.4))
           mode: partial2
           File Output Operator
             compressed: false
@@ -65,15 +65,15 @@
   Stage: Stage-2
     Map Reduce
       Alias -> Map Operator Tree:
-        /data/users/athusoo/apacheprojects/hive_local_ws3/build/ql/tmp/885399493/544614010.10001 
+        /data/users/athusoo/commits/hive_trunk_ws3/build/ql/tmp/1389629365/204290894.10001 
           Reduce Output Operator
             sort order: 
             tag: -1
             value expressions:
                   expr: 0
-                  type: string
-                  expr: 1
                   type: double
+                  expr: 1
+                  type: string
                   expr: 2
                   type: string
                   expr: 3
@@ -83,21 +83,21 @@
       Reduce Operator Tree:
         Group By Operator
           aggregations:
-                expr: avg(UDFToDouble(VALUE.0))
-                expr: sum(VALUE.1)
+                expr: sum(VALUE.0)
+                expr: max(VALUE.1)
                 expr: avg(UDFToDouble(VALUE.2))
                 expr: min(VALUE.3)
-                expr: max(VALUE.4)
+                expr: avg(UDFToDouble(VALUE.4))
           mode: final
           Select Operator
             expressions:
-                  expr: 1
-                  type: double
-                  expr: 2
-                  type: double
                   expr: 0
                   type: double
                   expr: 4
+                  type: double
+                  expr: 2
+                  type: double
+                  expr: 1
                   type: string
                   expr: 3
                   type: string

Modified: hadoop/hive/trunk/ql/src/test/results/clientpositive/groupby4.q.out
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/test/results/clientpositive/groupby4.q.out?rev=738309&r1=738308&r2=738309&view=diff
==============================================================================
--- hadoop/hive/trunk/ql/src/test/results/clientpositive/groupby4.q.out (original)
+++ hadoop/hive/trunk/ql/src/test/results/clientpositive/groupby4.q.out Wed Jan 28 00:05:30 2009
@@ -1,5 +1,5 @@
 ABSTRACT SYNTAX TREE:
-  (TOK_QUERY (TOK_FROM (TOK_TABREF src)) (TOK_INSERT (TOK_DESTINATION (TOK_TAB dest1)) (TOK_SELECT (TOK_SELEXPR (TOK_FUNCTION substr (TOK_COLREF src key) 0 1))) (TOK_GROUPBY (TOK_FUNCTION substr (TOK_COLREF src key) 0 1))))
+  (TOK_QUERY (TOK_FROM (TOK_TABREF src)) (TOK_INSERT (TOK_DESTINATION (TOK_TAB dest1)) (TOK_SELECT (TOK_SELEXPR (TOK_FUNCTION substr (TOK_COLREF src key) 1 1))) (TOK_GROUPBY (TOK_FUNCTION substr (TOK_COLREF src key) 1 1))))
 
 STAGE DEPENDENCIES:
   Stage-1 is a root stage
@@ -17,7 +17,7 @@
                     type: string
               Reduce Output Operator
                 key expressions:
-                      expr: substr(0, 0, 1)
+                      expr: substr(0, 1, 1)
                       type: string
                 sort order: +
                 Map-reduce partition columns:

Modified: hadoop/hive/trunk/ql/src/test/results/clientpositive/groupby5.q.out
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/test/results/clientpositive/groupby5.q.out?rev=738309&r1=738308&r2=738309&view=diff
==============================================================================
--- hadoop/hive/trunk/ql/src/test/results/clientpositive/groupby5.q.out (original)
+++ hadoop/hive/trunk/ql/src/test/results/clientpositive/groupby5.q.out Wed Jan 28 00:05:30 2009
@@ -1,5 +1,5 @@
 ABSTRACT SYNTAX TREE:
-  (TOK_QUERY (TOK_FROM (TOK_TABREF src)) (TOK_INSERT (TOK_DESTINATION (TOK_TAB dest1)) (TOK_SELECT (TOK_SELEXPR (TOK_COLREF src key)) (TOK_SELEXPR (TOK_FUNCTION sum (TOK_FUNCTION substr (TOK_COLREF src value) 4)))) (TOK_GROUPBY (TOK_COLREF src key))))
+  (TOK_QUERY (TOK_FROM (TOK_TABREF src)) (TOK_INSERT (TOK_DESTINATION (TOK_TAB dest1)) (TOK_SELECT (TOK_SELEXPR (TOK_COLREF src key)) (TOK_SELEXPR (TOK_FUNCTION sum (TOK_FUNCTION substr (TOK_COLREF src value) 5)))) (TOK_GROUPBY (TOK_COLREF src key))))
 
 STAGE DEPENDENCIES:
   Stage-1 is a root stage
@@ -21,7 +21,7 @@
                     type: double
               tag: -1
               value expressions:
-                    expr: substr(value, 4)
+                    expr: substr(value, 5)
                     type: string
       Reduce Operator Tree:
         Group By Operator

Modified: hadoop/hive/trunk/ql/src/test/results/clientpositive/groupby6.q.out
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/test/results/clientpositive/groupby6.q.out?rev=738309&r1=738308&r2=738309&view=diff
==============================================================================
--- hadoop/hive/trunk/ql/src/test/results/clientpositive/groupby6.q.out (original)
+++ hadoop/hive/trunk/ql/src/test/results/clientpositive/groupby6.q.out Wed Jan 28 00:05:30 2009
@@ -1,5 +1,5 @@
 ABSTRACT SYNTAX TREE:
-  (TOK_QUERY (TOK_FROM (TOK_TABREF src)) (TOK_INSERT (TOK_DESTINATION (TOK_TAB dest1)) (TOK_SELECTDI (TOK_SELEXPR (TOK_FUNCTION substr (TOK_COLREF src value) 4 1)))))
+  (TOK_QUERY (TOK_FROM (TOK_TABREF src)) (TOK_INSERT (TOK_DESTINATION (TOK_TAB dest1)) (TOK_SELECTDI (TOK_SELEXPR (TOK_FUNCTION substr (TOK_COLREF src value) 5 1)))))
 
 STAGE DEPENDENCIES:
   Stage-1 is a root stage
@@ -17,7 +17,7 @@
                     type: string
               Reduce Output Operator
                 key expressions:
-                      expr: substr(0, 4, 1)
+                      expr: substr(0, 5, 1)
                       type: string
                 sort order: +
                 Map-reduce partition columns:

Added: hadoop/hive/trunk/ql/src/test/results/clientpositive/udf_substr.q.out
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/test/results/clientpositive/udf_substr.q.out?rev=738309&view=auto
==============================================================================
--- hadoop/hive/trunk/ql/src/test/results/clientpositive/udf_substr.q.out (added)
+++ hadoop/hive/trunk/ql/src/test/results/clientpositive/udf_substr.q.out Wed Jan 28 00:05:30 2009
@@ -0,0 +1,5 @@
+NULL	NULL	NULL	NULL	NULL
+												
+CDEF	CDEF	CDEFG	CDEFG	ABC	ABC	BC	C	ABC	BC	A	A	A
+A	AB	ABC	ABC	A	AB	ABC	ABC	B	BC	BC	BC	C	C	C	C	
+C	C	C	C	B	BC	BC	BC	A	AB	ABC	ABC	

Modified: hadoop/hive/trunk/ql/src/test/results/compiler/parse/groupby1.q.out
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/test/results/compiler/parse/groupby1.q.out?rev=738309&r1=738308&r2=738309&view=diff
==============================================================================
--- hadoop/hive/trunk/ql/src/test/results/compiler/parse/groupby1.q.out (original)
+++ hadoop/hive/trunk/ql/src/test/results/compiler/parse/groupby1.q.out Wed Jan 28 00:05:30 2009
@@ -1 +1 @@
-(TOK_QUERY (TOK_FROM (TOK_TABREF src)) (TOK_INSERT (TOK_DESTINATION (TOK_TAB dest1)) (TOK_SELECT (TOK_SELEXPR (TOK_COLREF src key)) (TOK_SELEXPR (TOK_FUNCTION sum (TOK_FUNCTION substr (TOK_COLREF src value) 4)))) (TOK_GROUPBY (TOK_COLREF src key)))) null
\ No newline at end of file
+(TOK_QUERY (TOK_FROM (TOK_TABREF src)) (TOK_INSERT (TOK_DESTINATION (TOK_TAB dest1)) (TOK_SELECT (TOK_SELEXPR (TOK_COLREF src key)) (TOK_SELEXPR (TOK_FUNCTION sum (TOK_FUNCTION substr (TOK_COLREF src value) 5)))) (TOK_GROUPBY (TOK_COLREF src key)))) null
\ No newline at end of file

Modified: hadoop/hive/trunk/ql/src/test/results/compiler/parse/groupby2.q.out
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/test/results/compiler/parse/groupby2.q.out?rev=738309&r1=738308&r2=738309&view=diff
==============================================================================
--- hadoop/hive/trunk/ql/src/test/results/compiler/parse/groupby2.q.out (original)
+++ hadoop/hive/trunk/ql/src/test/results/compiler/parse/groupby2.q.out Wed Jan 28 00:05:30 2009
@@ -1 +1 @@
-(TOK_QUERY (TOK_FROM (TOK_TABREF src)) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (TOK_FUNCTION substr (TOK_COLREF src key) 0 1)) (TOK_SELEXPR (TOK_FUNCTIONDI count (TOK_FUNCTION substr (TOK_COLREF src value) 4))) (TOK_SELEXPR (TOK_FUNCTION concat (TOK_FUNCTION substr (TOK_COLREF src key) 0 1) (TOK_FUNCTION sum (TOK_FUNCTION substr (TOK_COLREF src value) 4))))) (TOK_GROUPBY (TOK_FUNCTION substr (TOK_COLREF src key) 0 1)))) null
\ No newline at end of file
+(TOK_QUERY (TOK_FROM (TOK_TABREF src)) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (TOK_FUNCTION substr (TOK_COLREF src key) 1 1)) (TOK_SELEXPR (TOK_FUNCTIONDI count (TOK_FUNCTION substr (TOK_COLREF src value) 5))) (TOK_SELEXPR (TOK_FUNCTION concat (TOK_FUNCTION substr (TOK_COLREF src key) 1 1) (TOK_FUNCTION sum (TOK_FUNCTION substr (TOK_COLREF src value) 5))))) (TOK_GROUPBY (TOK_FUNCTION substr (TOK_COLREF src key) 1 1)))) null
\ No newline at end of file

Modified: hadoop/hive/trunk/ql/src/test/results/compiler/parse/groupby3.q.out
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/test/results/compiler/parse/groupby3.q.out?rev=738309&r1=738308&r2=738309&view=diff
==============================================================================
--- hadoop/hive/trunk/ql/src/test/results/compiler/parse/groupby3.q.out (original)
+++ hadoop/hive/trunk/ql/src/test/results/compiler/parse/groupby3.q.out Wed Jan 28 00:05:30 2009
@@ -1 +1 @@
-(TOK_QUERY (TOK_FROM (TOK_TABREF src)) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (TOK_FUNCTION sum (TOK_FUNCTION substr (TOK_COLREF src value) 4))) (TOK_SELEXPR (TOK_FUNCTION avg (TOK_FUNCTION substr (TOK_COLREF src value) 4))) (TOK_SELEXPR (TOK_FUNCTIONDI avg (TOK_FUNCTION substr (TOK_COLREF src value) 4))) (TOK_SELEXPR (TOK_FUNCTION max (TOK_FUNCTION substr (TOK_COLREF src value) 4))) (TOK_SELEXPR (TOK_FUNCTION min (TOK_FUNCTION substr (TOK_COLREF src value) 4)))))) null
\ No newline at end of file
+(TOK_QUERY (TOK_FROM (TOK_TABREF src)) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (TOK_FUNCTION sum (TOK_FUNCTION substr (TOK_COLREF src value) 5))) (TOK_SELEXPR (TOK_FUNCTION avg (TOK_FUNCTION substr (TOK_COLREF src value) 5))) (TOK_SELEXPR (TOK_FUNCTIONDI avg (TOK_FUNCTION substr (TOK_COLREF src value) 5))) (TOK_SELEXPR (TOK_FUNCTION max (TOK_FUNCTION substr (TOK_COLREF src value) 5))) (TOK_SELEXPR (TOK_FUNCTION min (TOK_FUNCTION substr (TOK_COLREF src value) 5)))))) null
\ No newline at end of file

Modified: hadoop/hive/trunk/ql/src/test/results/compiler/parse/groupby4.q.out
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/test/results/compiler/parse/groupby4.q.out?rev=738309&r1=738308&r2=738309&view=diff
==============================================================================
--- hadoop/hive/trunk/ql/src/test/results/compiler/parse/groupby4.q.out (original)
+++ hadoop/hive/trunk/ql/src/test/results/compiler/parse/groupby4.q.out Wed Jan 28 00:05:30 2009
@@ -1 +1 @@
-(TOK_QUERY (TOK_FROM (TOK_TABREF src)) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (TOK_FUNCTION substr (TOK_COLREF src key) 0 1))) (TOK_GROUPBY (TOK_FUNCTION substr (TOK_COLREF src key) 0 1)))) null
\ No newline at end of file
+(TOK_QUERY (TOK_FROM (TOK_TABREF src)) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (TOK_FUNCTION substr (TOK_COLREF src key) 1 1))) (TOK_GROUPBY (TOK_FUNCTION substr (TOK_COLREF src key) 1 1)))) null
\ No newline at end of file

Modified: hadoop/hive/trunk/ql/src/test/results/compiler/parse/groupby5.q.out
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/test/results/compiler/parse/groupby5.q.out?rev=738309&r1=738308&r2=738309&view=diff
==============================================================================
--- hadoop/hive/trunk/ql/src/test/results/compiler/parse/groupby5.q.out (original)
+++ hadoop/hive/trunk/ql/src/test/results/compiler/parse/groupby5.q.out Wed Jan 28 00:05:30 2009
@@ -1 +1 @@
-(TOK_QUERY (TOK_FROM (TOK_TABREF src)) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (TOK_COLREF src key)) (TOK_SELEXPR (TOK_FUNCTION sum (TOK_FUNCTION substr (TOK_COLREF src value) 4)))) (TOK_GROUPBY (TOK_COLREF src key)))) null
\ No newline at end of file
+(TOK_QUERY (TOK_FROM (TOK_TABREF src)) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (TOK_COLREF src key)) (TOK_SELEXPR (TOK_FUNCTION sum (TOK_FUNCTION substr (TOK_COLREF src value) 5)))) (TOK_GROUPBY (TOK_COLREF src key)))) null
\ No newline at end of file

Modified: hadoop/hive/trunk/ql/src/test/results/compiler/parse/groupby6.q.out
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/test/results/compiler/parse/groupby6.q.out?rev=738309&r1=738308&r2=738309&view=diff
==============================================================================
--- hadoop/hive/trunk/ql/src/test/results/compiler/parse/groupby6.q.out (original)
+++ hadoop/hive/trunk/ql/src/test/results/compiler/parse/groupby6.q.out Wed Jan 28 00:05:30 2009
@@ -1 +1 @@
-(TOK_QUERY (TOK_FROM (TOK_TABREF src)) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECTDI (TOK_SELEXPR (TOK_FUNCTION substr (TOK_COLREF src value) 4 1))))) null
\ No newline at end of file
+(TOK_QUERY (TOK_FROM (TOK_TABREF src)) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECTDI (TOK_SELEXPR (TOK_FUNCTION substr (TOK_COLREF src value) 5 1))))) null
\ No newline at end of file

Modified: hadoop/hive/trunk/ql/src/test/results/compiler/plan/groupby1.q.xml
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/test/results/compiler/plan/groupby1.q.xml?rev=738309&r1=738308&r2=738309&view=diff
==============================================================================
--- hadoop/hive/trunk/ql/src/test/results/compiler/plan/groupby1.q.xml (original)
+++ hadoop/hive/trunk/ql/src/test/results/compiler/plan/groupby1.q.xml Wed Jan 28 00:05:30 2009
@@ -486,7 +486,7 @@
                               <class>java.lang.String</class> 
                              </void> 
                              <void index="1"> 
-                              <class>int</class> 
+                              <class>java.lang.Integer</class> 
                              </void> 
                             </array> 
                            </object> 
@@ -513,7 +513,7 @@
                                </object> 
                               </void> 
                               <void property="value"> 
-                               <int>4</int> 
+                               <int>5</int> 
                               </void> 
                              </object> 
                             </void> 

Modified: hadoop/hive/trunk/ql/src/test/results/compiler/plan/groupby2.q.xml
URL: http://svn.apache.org/viewvc/hadoop/hive/trunk/ql/src/test/results/compiler/plan/groupby2.q.xml?rev=738309&r1=738308&r2=738309&view=diff
==============================================================================
--- hadoop/hive/trunk/ql/src/test/results/compiler/plan/groupby2.q.xml (original)
+++ hadoop/hive/trunk/ql/src/test/results/compiler/plan/groupby2.q.xml Wed Jan 28 00:05:30 2009
@@ -97,7 +97,7 @@
                   <void property="typeInfo"> 
                    <object id="PrimitiveTypeInfo1" class="org.apache.hadoop.hive.ql.typeinfo.PrimitiveTypeInfo"> 
                     <void property="primitiveClass"> 
-                     <class>java.lang.Long</class> 
+                     <class>java.lang.Double</class> 
                     </void> 
                    </object> 
                   </void> 
@@ -111,7 +111,7 @@
                   <void property="typeInfo"> 
                    <object id="PrimitiveTypeInfo2" class="org.apache.hadoop.hive.ql.typeinfo.PrimitiveTypeInfo"> 
                     <void property="primitiveClass"> 
-                     <class>java.lang.Double</class> 
+                     <class>java.lang.Long</class> 
                     </void> 
                    </object> 
                   </void> 
@@ -138,7 +138,7 @@
                   </void> 
                   <void method="put"> 
                    <string>serialization.ddl</string> 
-                   <string>struct binary_table { i64 reducesinkvalue0, double reducesinkvalue1}</string> 
+                   <string>struct binary_table { double reducesinkvalue0, i64 reducesinkvalue1}</string> 
                   </void> 
                   <void method="put"> 
                    <string>serialization.format</string> 
@@ -182,7 +182,7 @@
                           </void> 
                           <void method="put"> 
                            <string>serialization.ddl</string> 
-                           <string>struct binary_table { string temporarycol0, i64 temporarycol1, double temporarycol2}</string> 
+                           <string>struct binary_table { string temporarycol0, double temporarycol1, i64 temporarycol2}</string> 
                           </void> 
                           <void method="put"> 
                            <string>serialization.format</string> 
@@ -250,30 +250,6 @@
                     <void method="add"> 
                      <object class="org.apache.hadoop.hive.ql.plan.aggregationDesc"> 
                       <void property="aggregationClass"> 
-                       <class>org.apache.hadoop.hive.ql.udf.UDAFCount</class> 
-                      </void> 
-                      <void property="distinct"> 
-                       <boolean>true</boolean> 
-                      </void> 
-                      <void property="parameters"> 
-                       <object class="java.util.ArrayList"> 
-                        <void method="add"> 
-                         <object class="org.apache.hadoop.hive.ql.plan.exprNodeColumnDesc"> 
-                          <void property="column"> 
-                           <string>KEY.1</string> 
-                          </void> 
-                          <void property="typeInfo"> 
-                           <object idref="PrimitiveTypeInfo0"/> 
-                          </void> 
-                         </object> 
-                        </void> 
-                       </object> 
-                      </void> 
-                     </object> 
-                    </void> 
-                    <void method="add"> 
-                     <object class="org.apache.hadoop.hive.ql.plan.aggregationDesc"> 
-                      <void property="aggregationClass"> 
                        <class>org.apache.hadoop.hive.ql.udf.UDAFSum</class> 
                       </void> 
                       <void property="parameters"> 
@@ -308,7 +284,31 @@
                            </object> 
                           </void> 
                           <void property="typeInfo"> 
-                           <object idref="PrimitiveTypeInfo2"/> 
+                           <object idref="PrimitiveTypeInfo1"/> 
+                          </void> 
+                         </object> 
+                        </void> 
+                       </object> 
+                      </void> 
+                     </object> 
+                    </void> 
+                    <void method="add"> 
+                     <object class="org.apache.hadoop.hive.ql.plan.aggregationDesc"> 
+                      <void property="aggregationClass"> 
+                       <class>org.apache.hadoop.hive.ql.udf.UDAFCount</class> 
+                      </void> 
+                      <void property="distinct"> 
+                       <boolean>true</boolean> 
+                      </void> 
+                      <void property="parameters"> 
+                       <object class="java.util.ArrayList"> 
+                        <void method="add"> 
+                         <object class="org.apache.hadoop.hive.ql.plan.exprNodeColumnDesc"> 
+                          <void property="column"> 
+                           <string>KEY.1</string> 
+                          </void> 
+                          <void property="typeInfo"> 
+                           <object idref="PrimitiveTypeInfo0"/> 
                           </void> 
                          </object> 
                         </void> 
@@ -360,10 +360,10 @@
                               <class>java.lang.String</class> 
                              </void> 
                              <void index="1"> 
-                              <class>int</class> 
+                              <class>java.lang.Integer</class> 
                              </void> 
                              <void index="2"> 
-                              <class>int</class> 
+                              <class>java.lang.Integer</class> 
                              </void> 
                             </array> 
                            </object> 
@@ -390,7 +390,7 @@
                                </object> 
                               </void> 
                               <void property="value"> 
-                               <int>0</int> 
+                               <int>1</int> 
                               </void> 
                              </object> 
                             </void> 
@@ -424,7 +424,7 @@
                               <class>java.lang.String</class> 
                              </void> 
                              <void index="1"> 
-                              <class>int</class> 
+                              <class>java.lang.Integer</class> 
                              </void> 
                             </array> 
                            </object> 
@@ -447,7 +447,7 @@
                                <object idref="PrimitiveTypeInfo3"/> 
                               </void> 
                               <void property="value"> 
-                               <int>4</int> 
+                               <int>5</int> 
                               </void> 
                              </object> 
                             </void> 
@@ -759,7 +759,7 @@
                          <string>1</string> 
                         </void> 
                         <void property="type"> 
-                         <object idref="PrimitiveTypeInfo1"/> 
+                         <object idref="PrimitiveTypeInfo2"/> 
                         </void> 
                        </object> 
                       </void> 
@@ -798,10 +798,10 @@
                   <void method="add"> 
                    <object class="org.apache.hadoop.hive.ql.plan.exprNodeColumnDesc"> 
                     <void property="column"> 
-                     <string>1</string> 
+                     <string>2</string> 
                     </void> 
                     <void property="typeInfo"> 
-                     <object idref="PrimitiveTypeInfo1"/> 
+                     <object idref="PrimitiveTypeInfo2"/> 
                     </void> 
                    </object> 
                   </void> 
@@ -855,10 +855,10 @@
                           <void method="add"> 
                            <object class="org.apache.hadoop.hive.ql.plan.exprNodeColumnDesc"> 
                             <void property="column"> 
-                             <string>2</string> 
+                             <string>1</string> 
                             </void> 
                             <void property="typeInfo"> 
-                             <object idref="PrimitiveTypeInfo2"/> 
+                             <object idref="PrimitiveTypeInfo1"/> 
                             </void> 
                            </object> 
                           </void> 
@@ -905,7 +905,7 @@
               <void method="add"> 
                <object class="org.apache.hadoop.hive.ql.plan.aggregationDesc"> 
                 <void property="aggregationClass"> 
-                 <class>org.apache.hadoop.hive.ql.udf.UDAFCount</class> 
+                 <class>org.apache.hadoop.hive.ql.udf.UDAFSum</class> 
                 </void> 
                 <void property="parameters"> 
                  <object class="java.util.ArrayList"> 
@@ -926,7 +926,7 @@
               <void method="add"> 
                <object class="org.apache.hadoop.hive.ql.plan.aggregationDesc"> 
                 <void property="aggregationClass"> 
-                 <class>org.apache.hadoop.hive.ql.udf.UDAFSum</class> 
+                 <class>org.apache.hadoop.hive.ql.udf.UDAFCount</class> 
                 </void> 
                 <void property="parameters"> 
                  <object class="java.util.ArrayList"> 



Mime
View raw message