hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ser...@apache.org
Subject svn commit: r1661793 - in /hive/branches/llap: llap-server/src/java/org/apache/hadoop/hive/llap/cache/ ql/src/test/queries/clientpositive/ ql/src/test/results/clientpositive/
Date Mon, 23 Feb 2015 21:51:04 GMT
Author: sershe
Date: Mon Feb 23 21:51:04 2015
New Revision: 1661793

URL: http://svn.apache.org/r1661793
Log:
Fix another bug and update the q files

Removed:
    hive/branches/llap/ql/src/test/queries/clientpositive/orc_llap2.q
    hive/branches/llap/ql/src/test/results/clientpositive/orc_llap2.q.out
Modified:
    hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/cache/LowLevelCacheImpl.java
    hive/branches/llap/ql/src/test/queries/clientpositive/orc_llap.q
    hive/branches/llap/ql/src/test/results/clientpositive/orc_llap.q.out

Modified: hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/cache/LowLevelCacheImpl.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/cache/LowLevelCacheImpl.java?rev=1661793&r1=1661792&r2=1661793&view=diff
==============================================================================
--- hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/cache/LowLevelCacheImpl.java
(original)
+++ hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/cache/LowLevelCacheImpl.java
Mon Feb 23 21:51:04 2015
@@ -118,7 +118,7 @@ public class LowLevelCacheImpl implement
       }
       cacheEnd = cacheOffset + buffer.declaredLength;
       CacheChunk currentCached = new CacheChunk(buffer, cacheOffset, cacheEnd);
-      currentNotCached = addCachedBufferToIter(currentNotCached, currentCached);
+      currentNotCached = addCachedBufferToIter(currentNotCached, currentCached, baseOffset);
       // Now that we've added it into correct position, we can adjust it by base offset.
       currentCached.shiftBy(-baseOffset);
     }
@@ -126,34 +126,36 @@ public class LowLevelCacheImpl implement
 
   /**
    * Adds cached buffer to buffer list.
-   * @param currentNotCached Pointer to the list node where we are inserting.
-   * @param currentCached The cached buffer found for this node, to insert.
+   * @param currentNotCached Pointer to the list node where we are inserting. Expressed in
stripe/stream offset.
+   * @param currentCached The cached buffer found for this node, to insert. Expressed in
file offset.
+   * @param baseOffset 
    * @return The new currentNotCached pointer, following the cached buffer insertion.
    */
   private DiskRangeList addCachedBufferToIter(
-      DiskRangeList currentNotCached, CacheChunk currentCached) {
+      DiskRangeList currentNotCached, CacheChunk currentCached, long baseOffset) {
     // Both currentNotCached and currentCached already include baseOffset.
-    if (currentNotCached.offset == currentCached.offset) {
-      if (currentNotCached.end <= currentCached.end) {  // we assume it's always "=="
now
+    long startOffset = baseOffset + currentNotCached.offset,
+        endOffset = baseOffset + currentNotCached.end;
+    if (startOffset == currentCached.offset) {
+      if (endOffset <= currentCached.end) {  // we assume it's always "==" now
         // Replace the entire current DiskRange with new cached range.
         currentNotCached.replaceSelfWith(currentCached);
         return null;
       } else {
         // Insert the new cache range before the disk range.
-        currentNotCached.offset = currentCached.end;
+        currentNotCached.offset = currentCached.end - baseOffset;
         currentNotCached.insertBefore(currentCached);
         return currentNotCached;
       }
     } else {
-      assert currentNotCached.offset < currentCached.offset;
-      long originalEnd = currentNotCached.end;
-      currentNotCached.end = currentCached.offset;
+      assert startOffset < currentCached.offset;
+      currentNotCached.end = currentCached.offset - baseOffset;
       currentNotCached.insertAfter(currentCached);
-      if (originalEnd <= currentCached.end) { // we assume it's always "==" now
+      if (endOffset <= currentCached.end) { // we assume it's always "==" now
         return null;  // No more matches expected...
       } else {
         // Insert the new disk range after the cache range. TODO: not strictly necessary
yet?
-        currentNotCached = new DiskRangeList(currentCached.end, originalEnd);
+        currentNotCached = new DiskRangeList(currentCached.end - baseOffset, endOffset);
         currentCached.insertAfter(currentNotCached);
         return currentNotCached;
       }

Modified: hive/branches/llap/ql/src/test/queries/clientpositive/orc_llap.q
URL: http://svn.apache.org/viewvc/hive/branches/llap/ql/src/test/queries/clientpositive/orc_llap.q?rev=1661793&r1=1661792&r2=1661793&view=diff
==============================================================================
--- hive/branches/llap/ql/src/test/queries/clientpositive/orc_llap.q (original)
+++ hive/branches/llap/ql/src/test/queries/clientpositive/orc_llap.q Mon Feb 23 21:51:04 2015
@@ -37,8 +37,11 @@ from alltypesorc cross join cross_number
 
 select count(*) from orc_llap;
 
+select sum(hash(*)) from (select cint, csmallint, cbigint from orc_llap where cint > 10
and cbigint is not null) tmp;
+select sum(hash(*)) from (select * from orc_llap where cint > 10 and cbigint is not null)
tmp;
+
 SET hive.llap.io.enabled=true;
-select sum(hash(*)) from (select cint, csmallint, cbigint from orc_llap where cint > 10
and cbigint is not null order by cbigint limit 1000) tmp;
-SET hive.llap.io.enabled=false;
-select sum(hash(*)) from (select cint, csmallint, cbigint from orc_llap where cint > 10
and cbigint is not null order by cbigint limit 1000) tmp;
+select sum(hash(*)) from (select cint, csmallint, cbigint from orc_llap where cint > 10
and cbigint is not null) tmp;
+select sum(hash(*)) from (select * from orc_llap where cint > 10 and cbigint is not null)
tmp;
+
 

Modified: hive/branches/llap/ql/src/test/results/clientpositive/orc_llap.q.out
URL: http://svn.apache.org/viewvc/hive/branches/llap/ql/src/test/results/clientpositive/orc_llap.q.out?rev=1661793&r1=1661792&r2=1661793&view=diff
==============================================================================
--- hive/branches/llap/ql/src/test/results/clientpositive/orc_llap.q.out (original)
+++ hive/branches/llap/ql/src/test/results/clientpositive/orc_llap.q.out Mon Feb 23 21:51:04
2015
@@ -89,21 +89,39 @@ POSTHOOK: type: QUERY
 POSTHOOK: Input: default@orc_llap
 #### A masked pattern was here ####
 122880
-PREHOOK: query: select sum(hash(*)) from (select cint, csmallint, cbigint from orc_llap where
cint > 10 and cbigint is not null order by cbigint limit 1000) tmp
+PREHOOK: query: select sum(hash(*)) from (select cint, csmallint, cbigint from orc_llap where
cint > 10 and cbigint is not null) tmp
 PREHOOK: type: QUERY
 PREHOOK: Input: default@orc_llap
 #### A masked pattern was here ####
-POSTHOOK: query: select sum(hash(*)) from (select cint, csmallint, cbigint from orc_llap
where cint > 10 and cbigint is not null order by cbigint limit 1000) tmp
+POSTHOOK: query: select sum(hash(*)) from (select cint, csmallint, cbigint from orc_llap
where cint > 10 and cbigint is not null) tmp
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@orc_llap
 #### A masked pattern was here ####
-239452960650
-PREHOOK: query: select sum(hash(*)) from (select cint, csmallint, cbigint from orc_llap where
cint > 10 and cbigint is not null order by cbigint limit 1000) tmp
+-558222259686
+PREHOOK: query: select sum(hash(*)) from (select * from orc_llap where cint > 10 and cbigint
is not null) tmp
 PREHOOK: type: QUERY
 PREHOOK: Input: default@orc_llap
 #### A masked pattern was here ####
-POSTHOOK: query: select sum(hash(*)) from (select cint, csmallint, cbigint from orc_llap
where cint > 10 and cbigint is not null order by cbigint limit 1000) tmp
+POSTHOOK: query: select sum(hash(*)) from (select * from orc_llap where cint > 10 and
cbigint is not null) tmp
 POSTHOOK: type: QUERY
 POSTHOOK: Input: default@orc_llap
 #### A masked pattern was here ####
-239452960650
+-197609091139
+PREHOOK: query: select sum(hash(*)) from (select cint, csmallint, cbigint from orc_llap where
cint > 10 and cbigint is not null) tmp
+PREHOOK: type: QUERY
+PREHOOK: Input: default@orc_llap
+#### A masked pattern was here ####
+POSTHOOK: query: select sum(hash(*)) from (select cint, csmallint, cbigint from orc_llap
where cint > 10 and cbigint is not null) tmp
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@orc_llap
+#### A masked pattern was here ####
+-558222259686
+PREHOOK: query: select sum(hash(*)) from (select * from orc_llap where cint > 10 and cbigint
is not null) tmp
+PREHOOK: type: QUERY
+PREHOOK: Input: default@orc_llap
+#### A masked pattern was here ####
+POSTHOOK: query: select sum(hash(*)) from (select * from orc_llap where cint > 10 and
cbigint is not null) tmp
+POSTHOOK: type: QUERY
+POSTHOOK: Input: default@orc_llap
+#### A masked pattern was here ####
+-197609091139



Mime
View raw message