hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From na...@apache.org
Subject svn commit: r1466835 - in /hive/trunk/ql/src: java/org/apache/hadoop/hive/ql/hooks/ReadEntity.java test/queries/clientpositive/view_inputs.q test/results/clientpositive/view_inputs.q.out
Date Thu, 11 Apr 2013 11:00:12 GMT
Author: namit
Date: Thu Apr 11 11:00:11 2013
New Revision: 1466835

URL: http://svn.apache.org/r1466835
Log:
HIVE-4336 Selecting from a view, and another view that also selects from that view fails
(Kevin Wilfong via namit)


Added:
    hive/trunk/ql/src/test/queries/clientpositive/view_inputs.q
    hive/trunk/ql/src/test/results/clientpositive/view_inputs.q.out
Modified:
    hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/hooks/ReadEntity.java

Modified: hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/hooks/ReadEntity.java
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/hooks/ReadEntity.java?rev=1466835&r1=1466834&r2=1466835&view=diff
==============================================================================
--- hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/hooks/ReadEntity.java (original)
+++ hive/trunk/ql/src/java/org/apache/hadoop/hive/ql/hooks/ReadEntity.java Thu Apr 11 11:00:11
2013
@@ -36,7 +36,7 @@ public class ReadEntity extends Entity i
   // The inputs will contain V and T (parent: V)
 
   // For views, the entities can be nested - by default, entities are at the top level
-  private Set<ReadEntity> parents = null;
+  private final Set<ReadEntity> parents = new HashSet<ReadEntity>();
 
   /**
    * For serialization only.
@@ -57,7 +57,6 @@ public class ReadEntity extends Entity i
 
   private void initParent(ReadEntity parent) {
     if (parent != null) {
-      this.parents = new HashSet<ReadEntity>();
       this.parents.add(parent);
     }
   }

Added: hive/trunk/ql/src/test/queries/clientpositive/view_inputs.q
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/queries/clientpositive/view_inputs.q?rev=1466835&view=auto
==============================================================================
--- hive/trunk/ql/src/test/queries/clientpositive/view_inputs.q (added)
+++ hive/trunk/ql/src/test/queries/clientpositive/view_inputs.q Thu Apr 11 11:00:11 2013
@@ -0,0 +1,7 @@
+-- Tests that selecting from a view and another view that selects from that same view
+
+CREATE VIEW test_view1 AS SELECT * FROM src;
+
+CREATE VIEW test_view2 AS SELECT * FROM test_view1;
+
+SELECT COUNT(*) FROM test_view1 a JOIN test_view2 b ON a.key = b.key;

Added: hive/trunk/ql/src/test/results/clientpositive/view_inputs.q.out
URL: http://svn.apache.org/viewvc/hive/trunk/ql/src/test/results/clientpositive/view_inputs.q.out?rev=1466835&view=auto
==============================================================================
--- hive/trunk/ql/src/test/results/clientpositive/view_inputs.q.out (added)
+++ hive/trunk/ql/src/test/results/clientpositive/view_inputs.q.out Thu Apr 11 11:00:11 2013
@@ -0,0 +1,29 @@
+PREHOOK: query: -- Tests that selecting from a view and another view that selects from that
same view
+
+CREATE VIEW test_view1 AS SELECT * FROM src
+PREHOOK: type: CREATEVIEW
+POSTHOOK: query: -- Tests that selecting from a view and another view that selects from that
same view
+
+CREATE VIEW test_view1 AS SELECT * FROM src
+POSTHOOK: type: CREATEVIEW
+POSTHOOK: Output: default@test_view1
+PREHOOK: query: CREATE VIEW test_view2 AS SELECT * FROM test_view1
+PREHOOK: type: CREATEVIEW
+PREHOOK: Input: default@test_view1
+POSTHOOK: query: CREATE VIEW test_view2 AS SELECT * FROM test_view1
+POSTHOOK: type: CREATEVIEW
+POSTHOOK: Input: default@test_view1
+POSTHOOK: Output: default@test_view2
+PREHOOK: query: SELECT COUNT(*) FROM test_view1 a JOIN test_view2 b ON a.key = b.key
+PREHOOK: type: QUERY
+PREHOOK: Input: default@src
+PREHOOK: Input: default@test_view1
+PREHOOK: Input: default@test_view2
+#### A masked pattern was here ####
+POSTHOOK: query: SELECT COUNT(*) FROM test_view1 a JOIN test_view2 b ON a.key = b.key
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@src
+POSTHOOK: Input: default@test_view1
+POSTHOOK: Input: default@test_view2
+#### A masked pattern was here ####
+1028



Mime
View raw message