hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hashut...@apache.org
Subject svn commit: r1541226 - in /hive/trunk/ql/src: java/org/apache/hadoop/hive/ql/parse/ParseDriver.java test/queries/clientpositive/create_view_translate.q test/results/clientpositive/create_view_translate.q.out
Date Tue, 12 Nov 2013 20:44:19 GMT
Author: hashutosh
Date: Tue Nov 12 20:44:18 2013
New Revision: 1541226

URL: http://svn.apache.org/r1541226
Log:
HIVE-4116 : Can't use views using map datatype. (Navis via Ashutosh Chauhan)

Modified:
    hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/ParseDriver.java
    hive/trunk/ql/src/test/queries/clientpositive/create_view_translate.q
    hive/trunk/ql/src/test/results/clientpositive/create_view_translate.q.out

Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/ParseDriver.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/ParseDriver.java?rev=1541226&r1=1541225&r2=1541226&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/ParseDriver.java (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/parse/ParseDriver.java Tue Nov 12 20:44:18
2013
@@ -201,7 +201,9 @@ public class ParseDriver {
       throw new ParseException(parser.errors);
     }
 
-    return (ASTNode) r.getTree();
+    ASTNode tree = (ASTNode) r.getTree();
+    tree.setUnknownTokenBoundaries();
+    return tree;
   }
 
 

Modified: hive/trunk/ql/src/test/queries/clientpositive/create_view_translate.q
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/queries/clientpositive/create_view_translate.q?rev=1541226&r1=1541225&r2=1541226&view=diff
==============================================================================
--- hive/trunk/ql/src/test/queries/clientpositive/create_view_translate.q (original)
+++ hive/trunk/ql/src/test/queries/clientpositive/create_view_translate.q Tue Nov 12 20:44:18
2013
@@ -11,3 +11,14 @@ describe formatted w;
 
 drop view v;
 drop view w;
+
+
+-- HIVE-4116 Can't use views using map datatype.
+
+CREATE TABLE items (id INT, name STRING, info MAP<STRING,STRING>);
+
+explain
+CREATE VIEW priceview AS SELECT items.id, items.info['price'] FROM items;
+CREATE VIEW priceview AS SELECT items.id, items.info['price'] FROM items;
+
+select * from priceview;

Modified: hive/trunk/ql/src/test/results/clientpositive/create_view_translate.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientpositive/create_view_translate.q.out?rev=1541226&r1=1541225&r2=1541226&view=diff
==============================================================================
--- hive/trunk/ql/src/test/results/clientpositive/create_view_translate.q.out (original)
+++ hive/trunk/ql/src/test/results/clientpositive/create_view_translate.q.out Tue Nov 12 20:44:18
2013
@@ -99,3 +99,52 @@ POSTHOOK: query: drop view w
 POSTHOOK: type: DROPVIEW
 POSTHOOK: Input: default@w
 POSTHOOK: Output: default@w
+PREHOOK: query: -- HIVE-4116 Can't use views using map datatype.
+
+CREATE TABLE items (id INT, name STRING, info MAP<STRING,STRING>)
+PREHOOK: type: CREATETABLE
+POSTHOOK: query: -- HIVE-4116 Can't use views using map datatype.
+
+CREATE TABLE items (id INT, name STRING, info MAP<STRING,STRING>)
+POSTHOOK: type: CREATETABLE
+POSTHOOK: Output: default@items
+PREHOOK: query: explain
+CREATE VIEW priceview AS SELECT items.id, items.info['price'] FROM items
+PREHOOK: type: CREATEVIEW
+POSTHOOK: query: explain
+CREATE VIEW priceview AS SELECT items.id, items.info['price'] FROM items
+POSTHOOK: type: CREATEVIEW
+ABSTRACT SYNTAX TREE:
+  (TOK_CREATEVIEW (TOK_TABNAME priceview) (TOK_QUERY (TOK_FROM (TOK_TABREF (TOK_TABNAME items)))
(TOK_INSERT (TOK_DESTINATION (TOK_DIR TOK_TMP_FILE)) (TOK_SELECT (TOK_SELEXPR (. (TOK_TABLE_OR_COL
items) id)) (TOK_SELEXPR ([ (. (TOK_TABLE_OR_COL items) info) 'price'))))))
+
+STAGE DEPENDENCIES:
+  Stage-0 is a root stage
+
+STAGE PLANS:
+  Stage: Stage-0
+      Create View Operator:
+        Create View
+          if not exists: false
+          is alter view as select: false
+          or replace: false
+          columns: id int, _c1 string
+          expanded text: SELECT `items`.`id`, `items`.`info`['price'] FROM `default`.`items`
+          name: priceview
+          original text: SELECT items.id, items.info['price'] FROM items
+
+
+PREHOOK: query: CREATE VIEW priceview AS SELECT items.id, items.info['price'] FROM items
+PREHOOK: type: CREATEVIEW
+POSTHOOK: query: CREATE VIEW priceview AS SELECT items.id, items.info['price'] FROM items
+POSTHOOK: type: CREATEVIEW
+POSTHOOK: Output: default@priceview
+PREHOOK: query: select * from priceview
+PREHOOK: type: QUERY
+PREHOOK: Input: default@items
+PREHOOK: Input: default@priceview
+#### A masked pattern was here ####
+POSTHOOK: query: select * from priceview
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@items
+POSTHOOK: Input: default@priceview
+#### A masked pattern was here ####



Mime
View raw message