hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From heyongqi...@apache.org
Subject svn commit: r1174531 - in /hive/trunk/ql/src: java/org/apache/hadoop/hive/ql/parse/Hive.g test/queries/clientpositive/innerjoin.q test/results/clientpositive/innerjoin.q.out
Date Fri, 23 Sep 2011 06:01:51 GMT
Author: heyongqiang
Date: Fri Sep 23 06:01:51 2011
New Revision: 1174531

URL: http://svn.apache.org/viewvc?rev=1174531&view=rev
Log:
HIVE-2462:make INNER a non-reserved keyword (John Sichi via He Yongqiang)

Modified:
    hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/Hive.g
    hive/trunk/ql/src/test/queries/clientpositive/innerjoin.q
    hive/trunk/ql/src/test/results/clientpositive/innerjoin.q.out

Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/Hive.g
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/Hive.g?rev=1174531&r1=1174530&r2=1174531&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/Hive.g (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/Hive.g Fri Sep 23 06:01:51 2011
@@ -1618,7 +1618,7 @@ joinToken
 @after { msgs.pop(); }
     :
       KW_JOIN                     -> TOK_JOIN
-    | KW_INNER KW_JOIN            -> TOK_JOIN
+    | kwInner  KW_JOIN            -> TOK_JOIN
     | KW_LEFT  KW_OUTER KW_JOIN   -> TOK_LEFTOUTERJOIN
     | KW_RIGHT KW_OUTER KW_JOIN   -> TOK_RIGHTOUTERJOIN
     | KW_FULL  KW_OUTER KW_JOIN   -> TOK_FULLOUTERJOIN
@@ -2102,6 +2102,10 @@ kwRole 
 : 
 {input.LT(1).getText().equalsIgnoreCase("role")}? Identifier;
 
+kwInner
+: 
+{input.LT(1).getText().equalsIgnoreCase("inner")}? Identifier;
+
 KW_TRUE : 'TRUE';
 KW_FALSE : 'FALSE';
 KW_ALL : 'ALL';
@@ -2130,7 +2134,6 @@ KW_OUTER : 'OUTER';
 KW_UNIQUEJOIN : 'UNIQUEJOIN';
 KW_PRESERVE : 'PRESERVE';
 KW_JOIN : 'JOIN';
-KW_INNER : 'INNER';
 KW_LEFT : 'LEFT';
 KW_RIGHT : 'RIGHT';
 KW_FULL : 'FULL';

Modified: hive/trunk/ql/src/test/queries/clientpositive/innerjoin.q
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/queries/clientpositive/innerjoin.q?rev=1174531&r1=1174530&r2=1174531&view=diff
==============================================================================
--- hive/trunk/ql/src/test/queries/clientpositive/innerjoin.q (original)
+++ hive/trunk/ql/src/test/queries/clientpositive/innerjoin.q Fri Sep 23 06:01:51 2011
@@ -9,3 +9,15 @@ FROM src src1 INNER JOIN src src2 ON (sr
 INSERT OVERWRITE TABLE dest_j1 SELECT src1.key, src2.value ORDER BY src1.key, src2.value;
 
 SELECT dest_j1.* FROM dest_j1;
+
+-- verify that INNER is a non-reserved word for backwards compatibility
+create table inner(i int);
+
+select i from inner;
+
+create table i(inner int);
+
+select inner from i;
+
+explain select * from (select * from src) inner left outer join src
+on inner.key=src.key;

Modified: hive/trunk/ql/src/test/results/clientpositive/innerjoin.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientpositive/innerjoin.q.out?rev=1174531&r1=1174530&r2=1174531&view=diff
==============================================================================
--- hive/trunk/ql/src/test/results/clientpositive/innerjoin.q.out (original)
+++ hive/trunk/ql/src/test/results/clientpositive/innerjoin.q.out Fri Sep 23 06:01:51 2011
@@ -80,7 +80,7 @@ STAGE PLANS:
   Stage: Stage-2
     Map Reduce
       Alias -> Map Operator Tree:
-        file:/tmp/bennies/hive_2011-06-27_03-03-57_197_6786583053992835762/-mr-10002 
+        file:/tmp/jsichi/hive_2011-09-22_12-28-33_200_3584565569223783349/-mr-10002 
             Reduce Output Operator
               key expressions:
                     expr: _col0
@@ -141,11 +141,11 @@ POSTHOOK: Lineage: dest_j1.value SIMPLE 
 PREHOOK: query: SELECT dest_j1.* FROM dest_j1
 PREHOOK: type: QUERY
 PREHOOK: Input: default@dest_j1
-PREHOOK: Output: file:/tmp/bennies/hive_2011-06-27_03-04-14_299_7962362076885293071/-mr-10000
+PREHOOK: Output: file:/tmp/jsichi/hive_2011-09-22_12-28-42_089_2614207070274392820/-mr-10000
 POSTHOOK: query: SELECT dest_j1.* FROM dest_j1
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@dest_j1
-POSTHOOK: Output: file:/tmp/bennies/hive_2011-06-27_03-04-14_299_7962362076885293071/-mr-10000
+POSTHOOK: Output: file:/tmp/jsichi/hive_2011-09-22_12-28-42_089_2614207070274392820/-mr-10000
 POSTHOOK: Lineage: dest_j1.key EXPRESSION [(src)src1.FieldSchema(name:key, type:string, comment:default),
]
 POSTHOOK: Lineage: dest_j1.value SIMPLE [(src)src2.FieldSchema(name:value, type:string, comment:default),
]
 0	val_0
@@ -1176,3 +1176,131 @@ POSTHOOK: Lineage: dest_j1.value SIMPLE 
 98	val_98
 98	val_98
 98	val_98
+PREHOOK: query: -- verify that INNER is a non-reserved word for backwards compatibility
+create table inner(i int)
+PREHOOK: type: CREATETABLE
+POSTHOOK: query: -- verify that INNER is a non-reserved word for backwards compatibility
+create table inner(i int)
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: default@inner
+POSTHOOK: Lineage: dest_j1.key EXPRESSION [(src)src1.FieldSchema(name:key, type:string, comment:default),
]
+POSTHOOK: Lineage: dest_j1.value SIMPLE [(src)src2.FieldSchema(name:value, type:string, comment:default),
]
+PREHOOK: query: select i from inner
+PREHOOK: type: QUERY
+PREHOOK: Input: default@inner
+PREHOOK: Output: file:/tmp/jsichi/hive_2011-09-22_12-28-42_406_4477395897921153797/-mr-10000
+POSTHOOK: query: select i from inner
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@inner
+POSTHOOK: Output: file:/tmp/jsichi/hive_2011-09-22_12-28-42_406_4477395897921153797/-mr-10000
+POSTHOOK: Lineage: dest_j1.key EXPRESSION [(src)src1.FieldSchema(name:key, type:string, comment:default),
]
+POSTHOOK: Lineage: dest_j1.value SIMPLE [(src)src2.FieldSchema(name:value, type:string, comment:default),
]
+PREHOOK: query: create table i(inner int)
+PREHOOK: type: CREATETABLE
+POSTHOOK: query: create table i(inner int)
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: default@i
+POSTHOOK: Lineage: dest_j1.key EXPRESSION [(src)src1.FieldSchema(name:key, type:string, comment:default),
]
+POSTHOOK: Lineage: dest_j1.value SIMPLE [(src)src2.FieldSchema(name:value, type:string, comment:default),
]
+PREHOOK: query: select inner from i
+PREHOOK: type: QUERY
+PREHOOK: Input: default@i
+PREHOOK: Output: file:/tmp/jsichi/hive_2011-09-22_12-28-45_279_6802539905532752103/-mr-10000
+POSTHOOK: query: select inner from i
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@i
+POSTHOOK: Output: file:/tmp/jsichi/hive_2011-09-22_12-28-45_279_6802539905532752103/-mr-10000
+POSTHOOK: Lineage: dest_j1.key EXPRESSION [(src)src1.FieldSchema(name:key, type:string, comment:default),
]
+POSTHOOK: Lineage: dest_j1.value SIMPLE [(src)src2.FieldSchema(name:value, type:string, comment:default),
]
+PREHOOK: query: explain select * from (select * from src) inner left outer join src
+on inner.key=src.key
+PREHOOK: type: QUERY
+POSTHOOK: query: explain select * from (select * from src) inner left outer join src
+on inner.key=src.key
+POSTHOOK: type: QUERY
+POSTHOOK: Lineage: dest_j1.key EXPRESSION [(src)src1.FieldSchema(name:key, type:string, comment:default),
]
+POSTHOOK: Lineage: dest_j1.value SIMPLE [(src)src2.FieldSchema(name:value, type:string, comment:default),
]
+ABSTRACT SYNTAX TREE:
+  (TOK_QUERY (TOK_FROM (TOK_LEFTOUTERJOIN (TOK_SUBQUERY (TOK_QUERY (TOK_FROM (TOK_TABREF
(TOK_TABNAME src))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR
TOK_ALLCOLREF)))) inner) (TOK_TABREF (TOK_TABNAME src)) (= (. (TOK_TABLE_OR_COL inner) key)
(. (TOK_TABLE_OR_COL src) key)))) (TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT
(TOK_SELEXPR TOK_ALLCOLREF))))
+
+STAGE DEPENDENCIES:
+  Stage-1 is a root stage
+  Stage-0 is a root stage
+
+STAGE PLANS:
+  Stage: Stage-1
+    Map Reduce
+      Alias -> Map Operator Tree:
+        inner:src 
+          TableScan
+            alias: src
+            Select Operator
+              expressions:
+                    expr: key
+                    type: string
+                    expr: value
+                    type: string
+              outputColumnNames: _col0, _col1
+              Reduce Output Operator
+                key expressions:
+                      expr: _col0
+                      type: string
+                sort order: +
+                Map-reduce partition columns:
+                      expr: _col0
+                      type: string
+                tag: 0
+                value expressions:
+                      expr: _col0
+                      type: string
+                      expr: _col1
+                      type: string
+        src 
+          TableScan
+            alias: src
+            Reduce Output Operator
+              key expressions:
+                    expr: key
+                    type: string
+              sort order: +
+              Map-reduce partition columns:
+                    expr: key
+                    type: string
+              tag: 1
+              value expressions:
+                    expr: key
+                    type: string
+                    expr: value
+                    type: string
+      Reduce Operator Tree:
+        Join Operator
+          condition map:
+               Left Outer Join0 to 1
+          condition expressions:
+            0 {VALUE._col0} {VALUE._col1}
+            1 {VALUE._col0} {VALUE._col1}
+          handleSkewJoin: false
+          outputColumnNames: _col0, _col1, _col2, _col3
+          Select Operator
+            expressions:
+                  expr: _col0
+                  type: string
+                  expr: _col1
+                  type: string
+                  expr: _col2
+                  type: string
+                  expr: _col3
+                  type: string
+            outputColumnNames: _col0, _col1, _col2, _col3
+            File Output Operator
+              compressed: false
+              GlobalTableId: 0
+              table:
+                  input format: org.apache.hadoop.mapred.TextInputFormat
+                  output format: org.apache.hadoop.hive.ql.io.HiveIgnoreKeyTextOutputFormat
+
+  Stage: Stage-0
+    Fetch Operator
+      limit: -1
+
+



Mime
View raw message