You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by se...@apache.org on 2015/03/17 21:34:06 UTC
svn commit: r1667395 [1/3] - in /hive/branches/llap: data/conf/
llap-server/src/java/org/apache/hadoop/hive/llap/cache/
llap-server/src/java/org/apache/hadoop/hive/llap/io/api/impl/
llap-server/src/java/org/apache/hadoop/hive/llap/io/encoded/ ql/src/ja...
Author: sershe
Date: Tue Mar 17 20:34:05 2015
New Revision: 1667395
URL: http://svn.apache.org/r1667395
Log:
HIVE-9978 : LLAP: OrcColumnVectorProducer should handle reading isPresent columns only (Sergey Shelukhin)
Added:
hive/branches/llap/ql/src/test/queries/clientpositive/llap_partitioned.q
hive/branches/llap/ql/src/test/results/clientpositive/llap_partitioned.q.out
Modified:
hive/branches/llap/data/conf/hive-site.xml
hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/cache/LowLevelCacheImpl.java
hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/cache/LowLevelCacheMemoryManager.java
hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/io/api/impl/LlapInputFormat.java
hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/io/encoded/OrcEncodedDataReader.java
hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/io/orc/EncodedReaderImpl.java
hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcInputFormat.java
hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/io/orc/RecordReaderImpl.java
hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/io/orc/RecordReaderUtils.java
hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/optimizer/physical/Vectorizer.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/data/conf/hive-site.xml
URL: http://svn.apache.org/viewvc/hive/branches/llap/data/conf/hive-site.xml?rev=1667395&r1=1667394&r2=1667395&view=diff
==============================================================================
--- hive/branches/llap/data/conf/hive-site.xml (original)
+++ hive/branches/llap/data/conf/hive-site.xml Tue Mar 17 20:34:05 2015
@@ -253,12 +253,12 @@
<property>
<name>hive.llap.io.cache.orc.size</name>
- <value>2097152</value>
+ <value>8388608</value>
</property>
<property>
<name>hive.llap.io.cache.orc.arena.size</name>
- <value>2097152</value>
+ <value>8388608</value>
</property>
<property>
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=1667395&r1=1667394&r2=1667395&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 Tue Mar 17 20:34:05 2015
@@ -165,7 +165,8 @@ public class LowLevelCacheImpl implement
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 - baseOffset, endOffset);
+ currentNotCached = new DiskRangeList(
+ currentCached.end - baseOffset, endOffset - baseOffset);
currentCached.insertAfter(currentNotCached);
return currentNotCached;
}
Modified: hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/cache/LowLevelCacheMemoryManager.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/cache/LowLevelCacheMemoryManager.java?rev=1667395&r1=1667394&r2=1667395&view=diff
==============================================================================
--- hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/cache/LowLevelCacheMemoryManager.java (original)
+++ hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/cache/LowLevelCacheMemoryManager.java Tue Mar 17 20:34:05 2015
@@ -52,6 +52,8 @@ public class LowLevelCacheMemoryManager
@Override
public boolean reserveMemory(long memoryToReserve, boolean waitForEviction) {
// TODO: if this cannot evict enough, it will spin infinitely. Terminate at some point?
+ int badCallCount = 0;
+ int nextLog = 4;
while (memoryToReserve > 0) {
long usedMem = usedMemory.get(), newUsedMem = usedMem + memoryToReserve;
if (newUsedMem <= maxSize) {
@@ -60,7 +62,20 @@ public class LowLevelCacheMemoryManager
}
// TODO: for one-block case, we could move notification for the last block out of the loop.
long evicted = evictor.evictSomeBlocks(memoryToReserve);
- if (!waitForEviction && evicted == 0) return false;
+ if (evicted == 0) {
+ if (!waitForEviction) return false;
+ ++badCallCount;
+ if (badCallCount == nextLog) {
+ LlapIoImpl.LOG.warn("Cannot evict blocks for " + badCallCount + " calls; cache full?");
+ nextLog <<= 1;
+ try {
+ Thread.sleep(500); // TODO#: incremental fallback
+ } catch (InterruptedException e) {
+ }
+ }
+ continue;
+ }
+ badCallCount = 0;
// Adjust the memory - we have to account for what we have just evicted.
while (true) {
long reserveWithEviction = Math.min(memoryToReserve, maxSize - usedMem + evicted);
Modified: hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/io/api/impl/LlapInputFormat.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/io/api/impl/LlapInputFormat.java?rev=1667395&r1=1667394&r2=1667395&view=diff
==============================================================================
--- hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/io/api/impl/LlapInputFormat.java (original)
+++ hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/io/api/impl/LlapInputFormat.java Tue Mar 17 20:34:05 2015
@@ -82,9 +82,6 @@ public class LlapInputFormat
try {
List<Integer> includedCols = ColumnProjectionUtils.isReadAllColumns(job)
? null : ColumnProjectionUtils.getReadColumnIDs(job);
- if (includedCols.isEmpty()) {
- includedCols = null; // Also means read all columns? WTF?
- }
return new LlapRecordReader(job, fileSplit, includedCols);
} catch (Exception ex) {
throw new IOException(ex);
@@ -178,7 +175,8 @@ public class LlapInputFormat
private void startRead() {
// Create the consumer of encoded data; it will coordinate decoding to CVBs.
- ReadPipeline rp = cvp.createReadPipeline(this, split, columnIds, sarg, columnNames, counters);
+ ReadPipeline rp = cvp.createReadPipeline(
+ this, split, columnIds, sarg, columnNames, counters);
feedback = rp;
ListenableFuture<Void> future = executor.submit(rp.getReadCallable());
// TODO: we should NOT do this thing with handler. Reader needs to do cleanup in most cases.
Modified: hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/io/encoded/OrcEncodedDataReader.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/io/encoded/OrcEncodedDataReader.java?rev=1667395&r1=1667394&r2=1667395&view=diff
==============================================================================
--- hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/io/encoded/OrcEncodedDataReader.java (original)
+++ hive/branches/llap/llap-server/src/java/org/apache/hadoop/hive/llap/io/encoded/OrcEncodedDataReader.java Tue Mar 17 20:34:05 2015
@@ -127,6 +127,7 @@ public class OrcEncodedDataReader extend
" LLAP low-level cache minimum allocation size (" + minAllocSize + "). Decrease the" +
" value for " + HiveConf.ConfVars.LLAP_ORC_CACHE_MIN_ALLOC.toString());
}
+ // TODO#: HERE 1
if (columnIds == null) {
columnIds = createColumnIds(fileMetadata);
}
@@ -234,15 +235,8 @@ public class OrcEncodedDataReader extend
} else {
// We are reading subset of the original columns, remove unnecessary bitmasks/etc.
// This will never happen w/o high-level cache.
- stripeIncludes = OrcInputFormat.genIncludedColumns(
- fileMetadata.getTypes(), cols, true);
- boolean[][] colRgs2 = new boolean[cols.size()][];
- for (int i = 0, i2 = -1; i < colRgs.length; ++i) {
- if (colRgs[i] == null) continue;
- colRgs2[i2] = colRgs[i];
- ++i2;
- }
- colRgs = colRgs2;
+ stripeIncludes = OrcInputFormat.genIncludedColumns(fileMetadata.getTypes(), cols, true);
+ colRgs = genStripeColRgs(cols, colRgs);
}
// 6.2. Ensure we have stripe metadata. We might have read it before for RG filtering.
@@ -291,11 +285,21 @@ public class OrcEncodedDataReader extend
LlapIoImpl.LOG.info("done processing " + split);
}
- // close the stripe reader, we are done reading
+ // Close the stripe reader, we are done reading.
stripeReader.close();
return null;
}
+ private boolean[][] genStripeColRgs(List<Integer> stripeCols, boolean[][] globalColRgs) {
+ boolean[][] stripeColRgs = new boolean[stripeCols.size()][];
+ for (int i = 0, i2 = -1; i < globalColRgs.length; ++i) {
+ if (globalColRgs[i] == null) continue;
+ stripeColRgs[i2] = globalColRgs[i];
+ ++i2;
+ }
+ return stripeColRgs;
+ }
+
/**
* Puts all column indexes from metadata to make a column list to read all column.
*/
Modified: hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/io/orc/EncodedReaderImpl.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/io/orc/EncodedReaderImpl.java?rev=1667395&r1=1667394&r2=1667395&view=diff
==============================================================================
--- hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/io/orc/EncodedReaderImpl.java (original)
+++ hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/io/orc/EncodedReaderImpl.java Tue Mar 17 20:34:05 2015
@@ -219,13 +219,13 @@ public class EncodedReaderImpl implement
// 2. Now, read all of the ranges from cache or disk.
DiskRangeListMutateHelper toRead = new DiskRangeListMutateHelper(listToRead.get());
if (DebugUtils.isTraceOrcEnabled()) {
- LOG.info("Resulting disk ranges to read: "
+ LOG.info("Resulting disk ranges to read (file " + fileId + "): "
+ RecordReaderUtils.stringifyDiskRanges(toRead.next));
}
if (cache != null) {
cache.getFileData(fileId, toRead.next, stripeOffset);
if (DebugUtils.isTraceOrcEnabled()) {
- LOG.info("Disk ranges after cache (base offset " + stripeOffset
+ LOG.info("Disk ranges after cache (file " + fileId + ", base offset " + stripeOffset
+ "): " + RecordReaderUtils.stringifyDiskRanges(toRead.next));
}
}
@@ -234,7 +234,7 @@ public class EncodedReaderImpl implement
RecordReaderUtils.readDiskRanges(file, zcr, stripeOffset, toRead.next, cache.isDirectAlloc());
if (DebugUtils.isTraceOrcEnabled()) {
- LOG.info("Disk ranges after disk read (base offset " + stripeOffset
+ LOG.info("Disk ranges after disk read (file " + fileId + ", base offset " + stripeOffset
+ "): " + RecordReaderUtils.stringifyDiskRanges(toRead.next));
}
Modified: hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcInputFormat.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcInputFormat.java?rev=1667395&r1=1667394&r2=1667395&view=diff
==============================================================================
--- hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcInputFormat.java (original)
+++ hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/io/orc/OrcInputFormat.java Tue Mar 17 20:34:05 2015
@@ -256,7 +256,7 @@ public class OrcInputFormat implements
boolean[] result = new boolean[numColumns];
result[0] = true;
OrcProto.Type root = types.get(rootColumn);
- for(int i=0; i < root.getSubtypesCount(); ++i) {
+ for (int i = 0; i < root.getSubtypesCount(); ++i) {
if (included.contains(i)) {
includeColumnRecursive(types, result, root.getSubtypes(i),
rootColumn);
Modified: hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/io/orc/RecordReaderImpl.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/io/orc/RecordReaderImpl.java?rev=1667395&r1=1667394&r2=1667395&view=diff
==============================================================================
--- hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/io/orc/RecordReaderImpl.java (original)
+++ hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/io/orc/RecordReaderImpl.java Tue Mar 17 20:34:05 2015
@@ -2926,9 +2926,9 @@ public class RecordReaderImpl implements
bf = bloomFilterIndices[filterColumns[pred]].getBloomFilter(rowGroup);
}
leafValues[pred] = evaluatePredicateProto(stats, sargLeaves.get(pred), bf);
- if (LOG.isDebugEnabled()) {
- LOG.debug("Stats = " + stats);
- LOG.debug("Setting " + sargLeaves.get(pred) + " to " +
+ if (LOG.isTraceEnabled()) {
+ LOG.trace("Stats = " + stats);
+ LOG.trace("Setting " + sargLeaves.get(pred) + " to " +
leafValues[pred]);
}
} else {
Modified: hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/io/orc/RecordReaderUtils.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/io/orc/RecordReaderUtils.java?rev=1667395&r1=1667394&r2=1667395&view=diff
==============================================================================
--- hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/io/orc/RecordReaderUtils.java (original)
+++ hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/io/orc/RecordReaderUtils.java Tue Mar 17 20:34:05 2015
@@ -208,10 +208,13 @@ public class RecordReaderUtils {
boolean isFirst = true;
while (range != null) {
if (!isFirst) {
- buffer.append(", ");
+ buffer.append(", {");
+ } else {
+ buffer.append("{");
}
isFirst = false;
buffer.append(range.toString());
+ buffer.append("}");
range = range.next;
}
buffer.append("]");
Modified: hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/optimizer/physical/Vectorizer.java
URL: http://svn.apache.org/viewvc/hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/optimizer/physical/Vectorizer.java?rev=1667395&r1=1667394&r2=1667395&view=diff
==============================================================================
--- hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/optimizer/physical/Vectorizer.java (original)
+++ hive/branches/llap/ql/src/java/org/apache/hadoop/hive/ql/optimizer/physical/Vectorizer.java Tue Mar 17 20:34:05 2015
@@ -949,6 +949,7 @@ public class Vectorizer implements Physi
return validateMapJoinDesc(desc);
}
+ // TODO#: validate this
private boolean validateTableScanOperator(TableScanOperator op, MapWork mWork) {
TableScanDesc desc = op.getConf();
if (desc.isGatherStats()) {
@@ -1154,6 +1155,7 @@ public class Vectorizer implements Physi
ExprNodeGenericFuncDesc d = (ExprNodeGenericFuncDesc) desc;
boolean r = validateGenericUdf(d);
if (!r) {
+ LOG.info("Cannot vectorize UDF " + d);
return false;
}
}
Added: hive/branches/llap/ql/src/test/queries/clientpositive/llap_partitioned.q
URL: http://svn.apache.org/viewvc/hive/branches/llap/ql/src/test/queries/clientpositive/llap_partitioned.q?rev=1667395&view=auto
==============================================================================
--- hive/branches/llap/ql/src/test/queries/clientpositive/llap_partitioned.q (added)
+++ hive/branches/llap/ql/src/test/queries/clientpositive/llap_partitioned.q Tue Mar 17 20:34:05 2015
@@ -0,0 +1,64 @@
+SET hive.vectorized.execution.enabled=true;
+
+SET hive.llap.io.enabled=false;
+
+SET hive.exec.orc.default.buffer.size=32768;
+SET hive.exec.orc.default.row.index.stride=1000;
+SET hive.optimize.index.filter=true;
+
+set hive.auto.convert.join=true;
+set hive.exec.dynamic.partition=true;
+set hive.exec.dynamic.partition.mode=nonstrict;
+set hive.exec.max.dynamic.partitions.pernode=255;
+
+DROP TABLE orc_llap_part;
+DROP TABLE orc_llap_dim_part;
+
+CREATE TABLE orc_llap_part(
+ csmallint SMALLINT,
+ cint INT,
+ cbigint BIGINT,
+ cfloat FLOAT,
+ cdouble DOUBLE,
+ cstring1 STRING,
+ cstring2 STRING,
+ cboolean1 BOOLEAN,
+ cboolean2 BOOLEAN
+) PARTITIONED BY (ctinyint TINYINT) STORED AS ORC;
+
+CREATE TABLE orc_llap_dim_part(
+ csmallint SMALLINT,
+ cint INT,
+ cbigint BIGINT,
+ cfloat FLOAT,
+ cdouble DOUBLE,
+ cstring1 STRING,
+ cstring2 STRING,
+ cboolean1 BOOLEAN,
+ cboolean2 BOOLEAN
+) PARTITIONED BY (ctinyint TINYINT) STORED AS ORC;
+
+INSERT OVERWRITE TABLE orc_llap_part PARTITION (ctinyint)
+SELECT csmallint, cint, cbigint, cfloat, cdouble, cstring1, cstring2, cboolean1, cboolean2, ctinyint FROM alltypesorc;
+
+INSERT OVERWRITE TABLE orc_llap_dim_part PARTITION (ctinyint)
+SELECT null, null, sum(cbigint) as cbigint, null, null, null, null, null, null, ctinyint FROM alltypesorc WHERE ctinyint > 10 AND ctinyint < 21 GROUP BY ctinyint;
+
+drop table llap_temp_table;
+
+set hive.cbo.enable=false;
+SET hive.llap.io.enabled=true;
+SET hive.vectorized.execution.enabled=true;
+
+explain
+SELECT oft.ctinyint, oft.cint FROM orc_llap_part oft
+ INNER JOIN orc_llap_dim_part od ON oft.ctinyint = od.ctinyint;
+create table llap_temp_table as
+SELECT oft.ctinyint, oft.cint FROM orc_llap_part oft
+ INNER JOIN orc_llap_dim_part od ON oft.ctinyint = od.ctinyint;
+select sum(hash(*)) from llap_temp_table;
+drop table llap_temp_table;
+
+
+DROP TABLE orc_llap_part;
+DROP TABLE orc_llap_dim_part;
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=1667395&r1=1667394&r2=1667395&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 Tue Mar 17 20:34:05 2015
@@ -33,34 +33,44 @@ select ctinyint + i, csmallint + i, cint
from alltypesorc cross join cross_numbers;
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) 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) tmp;
-SET hive.llap.io.enabled=true;
-select sum(hash(*)) from (select * from orc_llap where cint > 10 and cbigint is not null) tmp;
-SET hive.llap.io.enabled=false;
-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 cstring2 from orc_llap where cint > 5 and cint < 10) tmp;
-SET hive.llap.io.enabled=false;
-select sum(hash(*)) from (select cstring2 from orc_llap where cint > 5 and cint < 10) tmp;
-
-SET hive.llap.io.enabled=true;
-select sum(hash(*)) from (select * from orc_llap inner join cross_numbers on csmallint = i) tmp;
-SET hive.llap.io.enabled=false;
-select sum(hash(*)) from (select * from orc_llap inner join cross_numbers on csmallint = i) tmp;
-
-SET hive.llap.io.enabled=true;
-select sum(hash(*)) from (select cstring1, cstring2, count(*) from orc_llap group by cstring1, cstring2) tmp;
-SET hive.llap.io.enabled=false;
-select sum(hash(*)) from (select cstring1, cstring2, count(*) from orc_llap group by cstring1, cstring2) tmp;
-
-SET hive.llap.io.enabled=true;
-select sum(hash(*)) from (select o1.cstring1, o2.cstring2 from orc_llap o1 inner join orc_llap o2 on o1.csmallint = o2.csmallint where o1.cbigint is not null and o2.cbigint is not null) tmp;
-SET hive.llap.io.enabled=false;
-select sum(hash(*)) from (select o1.cstring1, o2.cstring2 from orc_llap o1 inner join orc_llap o2 on o1.csmallint = o2.csmallint where o1.cbigint is not null and o2.cbigint is not null) tmp;
+-- Hash cannot be vectorized, so run hash as the last step on a temp table
+drop table llap_temp_table;
+explain
+select cint, csmallint, cbigint from orc_llap where cint > 10 and cbigint is not null;
+create table llap_temp_table as
+select cint, csmallint, cbigint from orc_llap where cint > 10 and cbigint is not null;
+select sum(hash(*)) from llap_temp_table;
+
+drop table llap_temp_table;
+explain
+select * from orc_llap where cint > 10 and cbigint is not null;
+create table llap_temp_table as
+select * from orc_llap where cint > 10 and cbigint is not null;
+select sum(hash(*)) from llap_temp_table;
+
+drop table llap_temp_table;
+explain
+select cstring2 from orc_llap where cint > 5 and cint < 10;
+create table llap_temp_table as
+select cstring2 from orc_llap where cint > 5 and cint < 10;
+select sum(hash(*)) from llap_temp_table;
+
+
+drop table llap_temp_table;
+explain
+select cstring1, cstring2, count(*) from orc_llap group by cstring1, cstring2;
+create table llap_temp_table as
+select cstring1, cstring2, count(*) from orc_llap group by cstring1, cstring2;
+select sum(hash(*)) from llap_temp_table;
+
+drop table llap_temp_table;
+explain
+select o1.cstring1, o2.cstring2 from orc_llap o1 inner join orc_llap o2 on o1.csmallint = o2.csmallint where o1.cbigint is not null and o2.cbigint is not null;
+create table llap_temp_table as
+select o1.cstring1, o2.cstring2 from orc_llap o1 inner join orc_llap o2 on o1.csmallint = o2.csmallint where o1.cbigint is not null and o2.cbigint is not null;
+select sum(hash(*)) from llap_temp_table;
-- multi-stripe test
insert into table orc_llap
@@ -69,32 +79,39 @@ from alltypesorc cross join cross_number
alter table orc_llap concatenate;
-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) 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) tmp;
-
-SET hive.llap.io.enabled=true;
-select sum(hash(*)) from (select * from orc_llap where cint > 10 and cbigint is not null) tmp;
-SET hive.llap.io.enabled=false;
-select sum(hash(*)) from (select * from orc_llap where cint > 10 and cbigint is not null) tmp;
+drop table llap_temp_table;
+explain
+select cint, csmallint, cbigint from orc_llap where cint > 10 and cbigint is not null;
+create table llap_temp_table as
+select cint, csmallint, cbigint from orc_llap where cint > 10 and cbigint is not null;
+select sum(hash(*)) from llap_temp_table;
+
+drop table llap_temp_table;
+explain
+select * from orc_llap where cint > 10 and cbigint is not null;
+create table llap_temp_table as
+select * from orc_llap where cint > 10 and cbigint is not null;
+select sum(hash(*)) from llap_temp_table;
+
+drop table llap_temp_table;
+explain
+select cstring2 from orc_llap where cint > 5 and cint < 10;
+create table llap_temp_table as
+select cstring2 from orc_llap where cint > 5 and cint < 10;
+select sum(hash(*)) from llap_temp_table;
+
+drop table llap_temp_table;
+explain
+select cstring1, cstring2, count(*) from orc_llap group by cstring1, cstring2;
+create table llap_temp_table as
+select cstring1, cstring2, count(*) from orc_llap group by cstring1, cstring2;
+select sum(hash(*)) from llap_temp_table;
+
+drop table llap_temp_table;
+explain
+select o1.cstring1, o2.cstring2 from orc_llap o1 inner join orc_llap o2 on o1.csmallint = o2.csmallint where o1.cbigint is not null and o2.cbigint is not null;
+create table llap_temp_table as
+select o1.cstring1, o2.cstring2 from orc_llap o1 inner join orc_llap o2 on o1.csmallint = o2.csmallint where o1.cbigint is not null and o2.cbigint is not null;
+select sum(hash(*)) from llap_temp_table;
-SET hive.llap.io.enabled=true;
-select sum(hash(*)) from (select cstring2 from orc_llap where cint > 5 and cint < 10) tmp;
-SET hive.llap.io.enabled=false;
-select sum(hash(*)) from (select cstring2 from orc_llap where cint > 5 and cint < 10) tmp;
-
-SET hive.llap.io.enabled=true;
-select sum(hash(*)) from (select * from orc_llap inner join cross_numbers on csmallint = i) tmp;
-SET hive.llap.io.enabled=false;
-select sum(hash(*)) from (select * from orc_llap inner join cross_numbers on csmallint = i) tmp;
-
-SET hive.llap.io.enabled=true;
-select sum(hash(*)) from (select cstring1, cstring2, count(*) from orc_llap group by cstring1, cstring2) tmp;
-SET hive.llap.io.enabled=false;
-select sum(hash(*)) from (select cstring1, cstring2, count(*) from orc_llap group by cstring1, cstring2) tmp;
-
-SET hive.llap.io.enabled=true;
-select sum(hash(*)) from (select o1.cstring1, o2.cstring2 from orc_llap o1 inner join orc_llap o2 on o1.csmallint = o2.csmallint where o1.cbigint is not null and o2.cbigint is not null) tmp;
-SET hive.llap.io.enabled=false;
-select sum(hash(*)) from (select o1.cstring1, o2.cstring2 from orc_llap o1 inner join orc_llap o2 on o1.csmallint = o2.csmallint where o1.cbigint is not null and o2.cbigint is not null) tmp;
+drop table llap_temp_table;
\ No newline at end of file