You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@drill.apache.org by ja...@apache.org on 2013/07/20 03:35:01 UTC

[13/17] git commit: Working Project merge build

Working Project merge build


Project: http://git-wip-us.apache.org/repos/asf/incubator-drill/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-drill/commit/3d41be41
Tree: http://git-wip-us.apache.org/repos/asf/incubator-drill/tree/3d41be41
Diff: http://git-wip-us.apache.org/repos/asf/incubator-drill/diff/3d41be41

Branch: refs/heads/execwork
Commit: 3d41be41d6a1c9dab7256a1044370348848a1ec3
Parents: 80b1d24
Author: Jacques Nadeau <ja...@apache.org>
Authored: Tue Jul 16 10:45:25 2013 -0700
Committer: Jacques Nadeau <ja...@apache.org>
Committed: Fri Jul 19 14:53:31 2013 -0700

----------------------------------------------------------------------
 .../common/src/main/protobuf/Types.proto        |   1 +
 sandbox/prototype/exec/java-exec/pom.xml        |  30 -
 .../templates/FixedValueVectors.java            |  31 +
 .../templates/NullableValueVectors.java         |  28 +
 .../templates/RepeatedValueVectors.java         |  38 +-
 .../ValueVectors/templates/TypeHelper.java      |   6 +-
 .../templates/VariableLengthVectors.java        |  29 +
 .../drill/exec/expr/EvaluationVisitor.java      |   5 +-
 .../exec/expr/ValueVectorReadExpression.java    |   1 -
 .../exec/expr/ValueVectorWriteExpression.java   |   1 -
 .../drill/exec/expr/fn/FunctionHolder.java      |  15 +-
 .../exec/physical/config/MockRecordReader.java  |   6 +-
 .../drill/exec/physical/config/MockScanPOP.java |   2 +-
 .../exec/physical/impl/FilterRecordBatch.java   |  30 +-
 .../impl/FilteringRecordBatchTransformer.java   |   6 +-
 .../drill/exec/physical/impl/OutputMutator.java |  14 +-
 .../drill/exec/physical/impl/ScanBatch.java     |  84 +-
 .../drill/exec/physical/impl/VectorHolder.java  |  12 +-
 .../exec/physical/impl/WireRecordBatch.java     |  19 +-
 .../impl/filter/EvaluationPredicate.java        |   2 +-
 .../physical/impl/filter/ExampleFilter.java     |  10 +-
 .../physical/impl/filter/FilterTemplate.java    |   2 +-
 .../impl/project/ProjectRecordBatch.java        |  43 +-
 .../exec/physical/impl/project/Projector.java   |   3 +-
 .../impl/project/ProjectorTemplate.java         |  11 +-
 .../physical/impl/project/TransferPairing.java  |  35 -
 .../drill/exec/record/MaterializedField.java    |   5 +-
 .../apache/drill/exec/record/RecordBatch.java   |   8 +-
 .../drill/exec/record/RecordBatchLoader.java    |  32 +-
 .../apache/drill/exec/record/TransferPair.java  |   8 +
 .../apache/drill/exec/record/WritableBatch.java |   8 +-
 .../exec/record/selection/SelectionVector2.java |  49 ++
 .../exec/record/selection/SelectionVector4.java |  41 +
 .../drill/exec/record/vector/BitUtil.java       | 108 ---
 .../drill/exec/record/vector/BufBitSet.java     | 847 -------------------
 .../exec/record/vector/NullValueException.java  |   9 -
 .../exec/record/vector/NullableFixed8.java      |  43 -
 .../exec/record/vector/SelectionVector.java     |  49 --
 .../exec/record/vector/SelectionVector2.java    |  49 --
 .../exec/record/vector/SelectionVector4.java    |  41 -
 .../drill/exec/store/JSONRecordReader.java      |  19 +-
 .../drill/exec/vector/AllocationHelper.java     |  15 +
 .../drill/exec/vector/BaseValueVector.java      |   2 -
 .../org/apache/drill/exec/vector/BitVector.java |  27 +
 .../apache/drill/exec/vector/ValueVector.java   |   5 +-
 .../apache/drill/exec/expr/ExpressionTest.java  |  11 +-
 .../exec/physical/impl/SimpleRootExec.java      |   4 +-
 .../physical/impl/TestSimpleFragmentRun.java    |  58 +-
 .../impl/project/TestSimpleProjection.java      |  17 +-
 .../exec/record/vector/TestOpenBitSet.java      | 361 --------
 .../exec/record/vector/TestValueVector.java     |  55 +-
 .../drill/exec/store/JSONRecordReaderTest.java  |  41 +-
 52 files changed, 482 insertions(+), 1894 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/3d41be41/sandbox/prototype/common/src/main/protobuf/Types.proto
----------------------------------------------------------------------
diff --git a/sandbox/prototype/common/src/main/protobuf/Types.proto b/sandbox/prototype/common/src/main/protobuf/Types.proto
index 58399de..17e371d 100644
--- a/sandbox/prototype/common/src/main/protobuf/Types.proto
+++ b/sandbox/prototype/common/src/main/protobuf/Types.proto
@@ -15,6 +15,7 @@ enum MinorType {
     BIGINT = 6;   //  eight byte signed integer
     DECIMAL4 = 7;   //  a decimal supporting precision between 1 and 8 (4 bits for decimal location, 1 sign)
     DECIMAL8 = 8;   //  a decimal supporting precision between 9 and 18 (5 bits for decimal location, 1 sign)
+    DECIMAL12 = 9;   //  a decimal supporting precision between 
     DECIMAL16 = 10;   //  a decimal supporting precision between 19 and 37 (6 bits for decimal location, 1 sign)
     MONEY = 11;   //  signed decimal with two digit precision
     DATE = 12;   //  days since 4713bc 

http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/3d41be41/sandbox/prototype/exec/java-exec/pom.xml
----------------------------------------------------------------------
diff --git a/sandbox/prototype/exec/java-exec/pom.xml b/sandbox/prototype/exec/java-exec/pom.xml
index f2f0bff..0290be1 100644
--- a/sandbox/prototype/exec/java-exec/pom.xml
+++ b/sandbox/prototype/exec/java-exec/pom.xml
@@ -179,7 +179,6 @@
                 <exec executable="protoc">
                   <arg value="--java_out=${target.gen.source.path}" />
                   <arg value="--proto_path=${proto.cas.path}" />
-<<<<<<< HEAD
                   <arg value="--proto_path=${project.basedir}/../../common/src/main/protobuf/" />
 									<arg line="${proto.files}" />
 								</exec>
@@ -226,34 +225,5 @@
 			<!-- </plugin> -->
 		</plugins>
 	</build>
-=======
-                  <arg
-                    value="--proto_path=${project.basedir}/../../common/src/main/protobuf/" />
-                  <arg line="${proto.files}" />
-                </exec>
-              </tasks>
-              <sourceRoot>${target.gen.source.path}</sourceRoot>
-            </configuration>
-            <goals>
-              <goal>run</goal>
-            </goals>
-          </execution>
-        </executions>
-      </plugin>
-      <!-- <plugin> -->
-      <!-- <groupId>com.github.igor-petruk.protobuf</groupId> -->
-      <!-- <artifactId>protobuf-maven-plugin</artifactId> -->
-      <!-- <version>0.6.2</version> -->
-      <!-- <executions> -->
-      <!-- <execution> -->
-      <!-- <goals> -->
-      <!-- <goal>run</goal> -->
-      <!-- </goals> -->
-      <!-- </execution> -->
-      <!-- </executions> -->
-      <!-- </plugin> -->
-    </plugins>
-  </build>
->>>>>>> Build working
 
 </project>

http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/3d41be41/sandbox/prototype/exec/java-exec/src/main/codegen/ValueVectors/templates/FixedValueVectors.java
----------------------------------------------------------------------
diff --git a/sandbox/prototype/exec/java-exec/src/main/codegen/ValueVectors/templates/FixedValueVectors.java b/sandbox/prototype/exec/java-exec/src/main/codegen/ValueVectors/templates/FixedValueVectors.java
index 7583d9f..e0c8406 100644
--- a/sandbox/prototype/exec/java-exec/src/main/codegen/ValueVectors/templates/FixedValueVectors.java
+++ b/sandbox/prototype/exec/java-exec/src/main/codegen/ValueVectors/templates/FixedValueVectors.java
@@ -9,6 +9,7 @@ package org.apache.drill.exec.vector;
 import io.netty.buffer.ByteBuf;
 
 import org.apache.drill.exec.memory.BufferAllocator;
+import org.apache.drill.exec.record.TransferPair;
 import org.apache.drill.exec.proto.UserBitShared.FieldMetadata;
 import org.apache.drill.exec.record.DeadBuf;
 import org.apache.drill.exec.record.MaterializedField;
@@ -49,6 +50,8 @@ public final class ${minor.class}Vector extends BaseDataValueVector implements F
   public Mutator getMutator(){
     return mutator;
   }
+  
+
 
   /**
    * Allocate a new buffer that supports setting at least the provided number of values.  May actually be sized bigger depending on underlying buffer rounding size. Must be called prior to using the ValueVector.
@@ -87,6 +90,33 @@ public final class ${minor.class}Vector extends BaseDataValueVector implements F
     assert metadata.getBufferLength() == loaded;
   }
   
+  public TransferPair getTransferPair(){
+    return new TransferImpl();
+  }
+  
+  public void transferTo(${minor.class}Vector target){
+    target.data = data;
+    target.data.retain();
+    target.recordCount = recordCount;
+    clear();
+  }
+  
+  private class TransferImpl implements TransferPair{
+    ${minor.class}Vector to;
+    
+    public TransferImpl(){
+      this.to = new ${minor.class}Vector(getField(), allocator);
+    }
+    
+    public ${minor.class}Vector getTo(){
+      return to;
+    }
+    
+    public void transfer(){
+      transferTo(to);
+    }
+  }
+  
   public final class Accessor extends BaseValueVector.BaseAccessor{
 
     public int getRecordCount() {
@@ -184,6 +214,7 @@ public final class ${minor.class}Vector extends BaseDataValueVector implements F
 
 
 
+
   
  }
 }

http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/3d41be41/sandbox/prototype/exec/java-exec/src/main/codegen/ValueVectors/templates/NullableValueVectors.java
----------------------------------------------------------------------
diff --git a/sandbox/prototype/exec/java-exec/src/main/codegen/ValueVectors/templates/NullableValueVectors.java b/sandbox/prototype/exec/java-exec/src/main/codegen/ValueVectors/templates/NullableValueVectors.java
index 3232f87..d2d436a 100644
--- a/sandbox/prototype/exec/java-exec/src/main/codegen/ValueVectors/templates/NullableValueVectors.java
+++ b/sandbox/prototype/exec/java-exec/src/main/codegen/ValueVectors/templates/NullableValueVectors.java
@@ -17,6 +17,7 @@ import org.apache.drill.exec.proto.SchemaDefProtos;
 import org.apache.drill.exec.proto.UserBitShared.FieldMetadata;
 import org.apache.drill.exec.record.DeadBuf;
 import org.apache.drill.exec.record.MaterializedField;
+import org.apache.drill.exec.record.TransferPair;
 import org.apache.drill.exec.vector.BaseValueVector;
 import org.apache.drill.exec.vector.BitVector;
 import org.apache.drill.exec.vector.UInt2Vector;
@@ -146,6 +147,33 @@ public final class Nullable${minor.class}Vector extends BaseValueVector implemen
   
   </#if>
   
+  public TransferPair getTransferPair(){
+    return new TransferImpl();
+  }
+  
+  public void transferTo(Nullable${minor.class}Vector target){
+    bits.transferTo(target.bits);
+    values.transferTo(target.values);
+    target.recordCount = recordCount;
+    clear();
+  }
+  
+  private class TransferImpl implements TransferPair{
+    Nullable${minor.class}Vector to;
+    
+    public TransferImpl(){
+      this.to = new Nullable${minor.class}Vector(getField(), allocator);
+    }
+    
+    public Nullable${minor.class}Vector getTo(){
+      return to;
+    }
+    
+    public void transfer(){
+      transferTo(to);
+    }
+  }
+  
   public Accessor getAccessor(){
     return accessor;
   }

http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/3d41be41/sandbox/prototype/exec/java-exec/src/main/codegen/ValueVectors/templates/RepeatedValueVectors.java
----------------------------------------------------------------------
diff --git a/sandbox/prototype/exec/java-exec/src/main/codegen/ValueVectors/templates/RepeatedValueVectors.java b/sandbox/prototype/exec/java-exec/src/main/codegen/ValueVectors/templates/RepeatedValueVectors.java
index 363e4c8..1976340 100644
--- a/sandbox/prototype/exec/java-exec/src/main/codegen/ValueVectors/templates/RepeatedValueVectors.java
+++ b/sandbox/prototype/exec/java-exec/src/main/codegen/ValueVectors/templates/RepeatedValueVectors.java
@@ -7,11 +7,6 @@ import org.apache.drill.exec.vector.UInt4Vector;
 <@pp.changeOutputFile name="Repeated${minor.class}Vector.java" />
 package org.apache.drill.exec.vector;
 
-
-
-
-
-
 import static com.google.common.base.Preconditions.checkArgument;
 import static com.google.common.base.Preconditions.checkState;
 import io.netty.buffer.ByteBuf;
@@ -25,6 +20,7 @@ import org.apache.drill.exec.proto.SchemaDefProtos;
 import org.apache.drill.exec.proto.UserBitShared.FieldMetadata;
 import org.apache.drill.exec.record.DeadBuf;
 import org.apache.drill.exec.record.MaterializedField;
+import org.apache.drill.exec.record.TransferPair;
 
 @SuppressWarnings("unused")
 /**
@@ -65,6 +61,35 @@ import org.apache.drill.exec.record.MaterializedField;
     return counts.getBufferSize() + offsets.getBufferSize() + values.getBufferSize();
   }
   
+  public TransferPair getTransferPair(){
+    return new TransferImpl();
+  }
+  
+  public void transferTo(Repeated${minor.class}Vector target){
+    counts.transferTo(target.counts);
+    offsets.transferTo(target.offsets);
+    values.transferTo(target.values);
+    target.parentValueCount = parentValueCount;
+    target.childValueCount = childValueCount;
+    clear();
+  }
+  
+  private class TransferImpl implements TransferPair{
+    Repeated${minor.class}Vector to;
+    
+    public TransferImpl(){
+      this.to = new Repeated${minor.class}Vector(getField(), allocator);
+    }
+    
+    public Repeated${minor.class}Vector getTo(){
+      return to;
+    }
+    
+    public void transfer(){
+      transferTo(to);
+    }
+  }
+  
   <#if type.major == "VarLen">
   @Override
   public FieldMetadata getMetadata() {
@@ -84,9 +109,6 @@ import org.apache.drill.exec.record.MaterializedField;
     mutator.reset();
     accessor.reset();
   }
-
-  
-
   
   @Override
   public int load(int dataBytes, int parentValueCount, int childValueCount, ByteBuf buf){

http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/3d41be41/sandbox/prototype/exec/java-exec/src/main/codegen/ValueVectors/templates/TypeHelper.java
----------------------------------------------------------------------
diff --git a/sandbox/prototype/exec/java-exec/src/main/codegen/ValueVectors/templates/TypeHelper.java b/sandbox/prototype/exec/java-exec/src/main/codegen/ValueVectors/templates/TypeHelper.java
index b03b842..b73cd21 100644
--- a/sandbox/prototype/exec/java-exec/src/main/codegen/ValueVectors/templates/TypeHelper.java
+++ b/sandbox/prototype/exec/java-exec/src/main/codegen/ValueVectors/templates/TypeHelper.java
@@ -18,9 +18,9 @@
 package org.apache.drill.exec.vector;
 
 import org.apache.drill.exec.memory.BufferAllocator;
-import org.apache.drill.exec.proto.SchemaDefProtos.DataMode;
-import org.apache.drill.exec.proto.SchemaDefProtos.MajorType;
-import org.apache.drill.exec.proto.SchemaDefProtos.MinorType;
+import org.apache.drill.common.types.TypeProtos.DataMode;
+import org.apache.drill.common.types.TypeProtos.MajorType;
+import org.apache.drill.common.types.TypeProtos.MinorType;
 import org.apache.drill.exec.record.MaterializedField;
 
 public class TypeHelper {

http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/3d41be41/sandbox/prototype/exec/java-exec/src/main/codegen/ValueVectors/templates/VariableLengthVectors.java
----------------------------------------------------------------------
diff --git a/sandbox/prototype/exec/java-exec/src/main/codegen/ValueVectors/templates/VariableLengthVectors.java b/sandbox/prototype/exec/java-exec/src/main/codegen/ValueVectors/templates/VariableLengthVectors.java
index c615258..9d723ab 100644
--- a/sandbox/prototype/exec/java-exec/src/main/codegen/ValueVectors/templates/VariableLengthVectors.java
+++ b/sandbox/prototype/exec/java-exec/src/main/codegen/ValueVectors/templates/VariableLengthVectors.java
@@ -19,6 +19,7 @@ import org.apache.drill.exec.proto.SchemaDefProtos;
 import org.apache.drill.exec.proto.UserBitShared.FieldMetadata;
 import org.apache.drill.exec.record.DeadBuf;
 import org.apache.drill.exec.record.MaterializedField;
+import org.apache.drill.exec.record.TransferPair;
 import org.apache.drill.exec.vector.ByteHolder;
 
 /**
@@ -102,6 +103,34 @@ public final class ${minor.class}Vector extends BaseDataValueVector implements V
     return new ByteBuf[]{offsetVector.data, this.data};
   }
   
+  public TransferPair getTransferPair(){
+    return new TransferImpl();
+  }
+  
+  public void transferTo(${minor.class}Vector target){
+    this.offsetVector.transferTo(target.offsetVector);
+    target.data = data;
+    target.data.retain();
+    target.recordCount = recordCount;
+    clear();
+  }
+  
+  private class TransferImpl implements TransferPair{
+    ${minor.class}Vector to;
+    
+    public TransferImpl(){
+      this.to = new ${minor.class}Vector(getField(), allocator);
+    }
+    
+    public ${minor.class}Vector getTo(){
+      return to;
+    }
+    
+    public void transfer(){
+      transferTo(to);
+    }
+  }
+  
   public void allocateNew(int totalBytes, int valueCount) {
     clear();
     assert totalBytes >= 0;

http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/3d41be41/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/expr/EvaluationVisitor.java
----------------------------------------------------------------------
diff --git a/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/expr/EvaluationVisitor.java b/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/expr/EvaluationVisitor.java
index 04f78d0..6b0e499 100644
--- a/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/expr/EvaluationVisitor.java
+++ b/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/expr/EvaluationVisitor.java
@@ -15,15 +15,14 @@ import org.apache.drill.exec.expr.CodeGenerator.HoldingContainer;
 import org.apache.drill.exec.expr.fn.FunctionHolder;
 import org.apache.drill.exec.expr.fn.FunctionImplementationRegistry;
 import org.apache.drill.exec.physical.impl.filter.SelectionVectorPopulationExpression;
-import org.apache.drill.exec.record.vector.SelectionVector2;
-import org.apache.drill.exec.record.vector.TypeHelper;
+import org.apache.drill.exec.record.selection.SelectionVector2;
+import org.apache.drill.exec.vector.TypeHelper;
 
 import com.google.common.base.Preconditions;
 import com.sun.codemodel.JBlock;
 import com.sun.codemodel.JClass;
 import com.sun.codemodel.JConditional;
 import com.sun.codemodel.JExpr;
-import com.sun.codemodel.JExpression;
 import com.sun.codemodel.JType;
 import com.sun.codemodel.JVar;
 

http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/3d41be41/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/expr/ValueVectorReadExpression.java
----------------------------------------------------------------------
diff --git a/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/expr/ValueVectorReadExpression.java b/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/expr/ValueVectorReadExpression.java
index c8d906d..b1888d6 100644
--- a/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/expr/ValueVectorReadExpression.java
+++ b/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/expr/ValueVectorReadExpression.java
@@ -5,7 +5,6 @@ import org.apache.drill.common.expression.LogicalExpression;
 import org.apache.drill.common.expression.visitors.ExprVisitor;
 import org.apache.drill.common.types.TypeProtos.MajorType;
 import org.apache.drill.exec.record.RecordBatch.TypedFieldId;
-import org.apache.drill.exec.record.vector.ValueVector;
 
 public class ValueVectorReadExpression implements LogicalExpression{
   static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(ValueVectorReadExpression.class);

http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/3d41be41/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/expr/ValueVectorWriteExpression.java
----------------------------------------------------------------------
diff --git a/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/expr/ValueVectorWriteExpression.java b/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/expr/ValueVectorWriteExpression.java
index 96d9d05..417b975 100644
--- a/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/expr/ValueVectorWriteExpression.java
+++ b/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/expr/ValueVectorWriteExpression.java
@@ -5,7 +5,6 @@ import org.apache.drill.common.expression.LogicalExpression;
 import org.apache.drill.common.expression.visitors.ExprVisitor;
 import org.apache.drill.common.types.TypeProtos.MajorType;
 import org.apache.drill.common.types.Types;
-import org.apache.drill.exec.record.vector.ValueVector;
 
 public class ValueVectorWriteExpression implements LogicalExpression {
   static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(ValueVectorWriteExpression.class);

http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/3d41be41/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/FunctionHolder.java
----------------------------------------------------------------------
diff --git a/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/FunctionHolder.java b/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/FunctionHolder.java
index f7ecd02..9d7fc35 100644
--- a/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/FunctionHolder.java
+++ b/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/FunctionHolder.java
@@ -1,6 +1,5 @@
 package org.apache.drill.exec.expr.fn;
 
-import java.lang.reflect.Type;
 import java.util.Arrays;
 import java.util.Map;
 
@@ -92,14 +91,16 @@ public class FunctionHolder {
     
     JVar[] workspaceJVars = new JVar[workspaceVars.length];
     for(int i =0 ; i < workspaceVars.length; i++){
-      workspaceJVars[i] = g.declareClassField("work", g.getModel()._ref(workspaceVars[i].type)));
+      workspaceJVars[i] = g.declareClassField("work", g.getModel()._ref(workspaceVars[i].type));
     }
     
-    for(WorkspaceReference r : workspaceVars){
-      g.declareClassField(, t)
-    }
-  
-    g.declareClassField(prefix, t)
+//    for(WorkspaceReference r : workspaceVars){
+//      g.declareClassField(, t)
+//    }
+//  
+//    g.declareClassField(prefix, t)
+    
+    
     // locally name external blocks.
     
     // internal out value.

http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/3d41be41/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/config/MockRecordReader.java
----------------------------------------------------------------------
diff --git a/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/config/MockRecordReader.java b/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/config/MockRecordReader.java
index 7b76d05..d710d78 100644
--- a/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/config/MockRecordReader.java
+++ b/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/config/MockRecordReader.java
@@ -28,8 +28,6 @@ import org.apache.drill.exec.physical.config.MockScanPOP.MockColumn;
 import org.apache.drill.exec.physical.config.MockScanPOP.MockScanEntry;
 import org.apache.drill.exec.physical.impl.OutputMutator;
 import org.apache.drill.exec.record.MaterializedField;
-import org.apache.drill.exec.record.vector.TypeHelper;
-import org.apache.drill.exec.record.vector.ValueVector;
 import org.apache.drill.exec.store.RecordReader;
 import org.apache.drill.exec.vector.FixedWidthVector;
 import org.apache.drill.exec.vector.NonRepeatedMutator;
@@ -60,12 +58,12 @@ public class MockRecordReader implements RecordReader {
     return x;
   }
 
-  private ValueVector<?> getVector(String name, MajorType type, int length) {
+  private ValueVector getVector(String name, MajorType type, int length) {
     assert context != null : "Context shouldn't be null.";
     if(type.getMode() != DataMode.REQUIRED) throw new UnsupportedOperationException();
     
     MaterializedField f = MaterializedField.create(new SchemaPath(name, ExpressionPosition.UNKNOWN), type);
-    ValueVector<?> v;
+    ValueVector v;
     v = TypeHelper.getNewVector(f, context.getAllocator());
     if(v instanceof FixedWidthVector){
       ((FixedWidthVector)v).allocateNew(length);  

http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/3d41be41/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/config/MockScanPOP.java
----------------------------------------------------------------------
diff --git a/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/config/MockScanPOP.java b/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/config/MockScanPOP.java
index 3802ce2..151d541 100644
--- a/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/config/MockScanPOP.java
+++ b/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/config/MockScanPOP.java
@@ -32,7 +32,7 @@ import org.apache.drill.exec.physical.base.PhysicalOperator;
 import org.apache.drill.exec.physical.base.Scan;
 import org.apache.drill.exec.physical.base.Size;
 import org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint;
-import org.apache.drill.exec.record.vector.TypeHelper;
+import org.apache.drill.exec.vector.TypeHelper;
 
 import com.fasterxml.jackson.annotation.JsonCreator;
 import com.fasterxml.jackson.annotation.JsonIgnore;

http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/3d41be41/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/FilterRecordBatch.java
----------------------------------------------------------------------
diff --git a/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/FilterRecordBatch.java b/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/FilterRecordBatch.java
index 1ddc3f9..acabe30 100644
--- a/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/FilterRecordBatch.java
+++ b/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/FilterRecordBatch.java
@@ -20,24 +20,17 @@ package org.apache.drill.exec.physical.impl;
 import org.apache.drill.common.expression.SchemaPath;
 import org.apache.drill.exec.ops.FragmentContext;
 import org.apache.drill.exec.record.BatchSchema;
-import org.apache.drill.exec.record.InvalidValueAccessor;
 import org.apache.drill.exec.record.RecordBatch;
-import org.apache.drill.exec.record.RecordBatch.TypedFieldId;
 import org.apache.drill.exec.record.WritableBatch;
-import org.apache.drill.exec.record.vector.SelectionVector;
-<<<<<<< HEAD
+import org.apache.drill.exec.record.selection.SelectionVector2;
+import org.apache.drill.exec.record.selection.SelectionVector4;
 import org.apache.drill.exec.vector.ValueVector;
-=======
-import org.apache.drill.exec.record.vector.SelectionVector2;
-import org.apache.drill.exec.record.vector.SelectionVector4;
-import org.apache.drill.exec.record.vector.ValueVector;
->>>>>>> Build working
 
 public abstract class FilterRecordBatch implements RecordBatch {
   static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(FilterRecordBatch.class);
 
   private RecordBatch incoming;
-  private SelectionVector selectionVector;
+  private SelectionVector2 selectionVector;
   private BatchSchema schema;
   private FilteringRecordBatchTransformer transformer;
   private int outstanding;
@@ -83,20 +76,15 @@ public abstract class FilterRecordBatch implements RecordBatch {
   }
 
   @Override
-  public <T extends ValueVector<T>> T getValueVectorById(int fieldId, Class<?> vvClass) {
+  public <T extends ValueVector> T getValueVectorById(int fieldId, Class<?> vvClass) {
     return null;
   }
 
-  @Override
-<<<<<<< HEAD
-  public <T extends ValueVector> T getValueVector(int fieldId, Class<T> clazz) throws InvalidValueAccessor {
-=======
   public WritableBatch getWritableBatch() {
->>>>>>> Build working
     return null;
   }
 
-  abstract int applyFilter(SelectionVector vector, int count);
+  abstract int applyFilter(SelectionVector2 vector, int count);
 
   /**
    * Release all assets.
@@ -130,10 +118,10 @@ public abstract class FilterRecordBatch implements RecordBatch {
         }
       }
 
-      // make sure the bit vector is as large as the current record batch.
-      if (selectionVector.capacity() < incoming.getRecordCount()) {
-        selectionVector.allocateNew(incoming.getRecordCount());
-      }
+//      // make sure the bit vector is as large as the current record batch.
+//      if (selectionVector.capacity() < incoming.getRecordCount()) {
+//        selectionVector.allocateNew(incoming.getRecordCount());
+//      }
 
       return null;
     }

http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/3d41be41/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/FilteringRecordBatchTransformer.java
----------------------------------------------------------------------
diff --git a/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/FilteringRecordBatchTransformer.java b/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/FilteringRecordBatchTransformer.java
index 191521a..0813481 100644
--- a/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/FilteringRecordBatchTransformer.java
+++ b/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/FilteringRecordBatchTransformer.java
@@ -19,16 +19,16 @@ package org.apache.drill.exec.physical.impl;
 
 import org.apache.drill.exec.record.BatchSchema;
 import org.apache.drill.exec.record.RecordBatch;
-import org.apache.drill.exec.record.vector.SelectionVector;
+import org.apache.drill.exec.record.selection.SelectionVector2;
 
 public abstract class FilteringRecordBatchTransformer {
   static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(FilteringRecordBatchTransformer.class);
   
   final RecordBatch incoming;
-  final SelectionVector selectionVector;
+  final SelectionVector2 selectionVector;
   final BatchSchema schema;
   
-  public FilteringRecordBatchTransformer(RecordBatch incoming, OutputMutator output, SelectionVector selectionVector) {
+  public FilteringRecordBatchTransformer(RecordBatch incoming, OutputMutator output, SelectionVector2 selectionVector) {
     super();
     this.incoming = incoming;
     this.selectionVector = selectionVector;

http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/3d41be41/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/OutputMutator.java
----------------------------------------------------------------------
diff --git a/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/OutputMutator.java b/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/OutputMutator.java
index 5247d08..7e72683 100644
--- a/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/OutputMutator.java
+++ b/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/OutputMutator.java
@@ -18,19 +18,11 @@
 package org.apache.drill.exec.physical.impl;
 
 import org.apache.drill.exec.exception.SchemaChangeException;
-<<<<<<< HEAD
-import org.apache.drill.exec.vector.ValueVector;
-
-public interface OutputMutator {
-  public void removeField(int fieldId) throws SchemaChangeException;
-  public void addField(int fieldId, ValueVector vector) throws SchemaChangeException ;
-=======
 import org.apache.drill.exec.record.MaterializedField;
-import org.apache.drill.exec.record.vector.ValueVector;
+import org.apache.drill.exec.vector.ValueVector;
 
 public interface OutputMutator {
   public void removeField(MaterializedField field) throws SchemaChangeException;
-  public void addField(ValueVector<?> vector) throws SchemaChangeException ;
->>>>>>> Build working
-  public void setNewSchema() throws SchemaChangeException ;
+  public void addField(ValueVector vector) throws SchemaChangeException ;
+  public void setNewSchema() throws SchemaChangeException;
 }

http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/3d41be41/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/ScanBatch.java
----------------------------------------------------------------------
diff --git a/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/ScanBatch.java b/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/ScanBatch.java
index be80349..5688bb1 100644
--- a/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/ScanBatch.java
+++ b/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/ScanBatch.java
@@ -18,37 +18,27 @@
 package org.apache.drill.exec.physical.impl;
 
 import java.util.Iterator;
-<<<<<<< HEAD
-=======
 import java.util.List;
 import java.util.Map;
->>>>>>> Build working
 
 import org.apache.drill.common.exceptions.ExecutionSetupException;
 import org.apache.drill.common.expression.SchemaPath;
 import org.apache.drill.exec.exception.SchemaChangeException;
 import org.apache.drill.exec.ops.FragmentContext;
 import org.apache.drill.exec.record.BatchSchema;
+import org.apache.drill.exec.record.InvalidValueAccessor;
 import org.apache.drill.exec.record.MaterializedField;
 import org.apache.drill.exec.record.RecordBatch;
 import org.apache.drill.exec.record.SchemaBuilder;
 import org.apache.drill.exec.record.WritableBatch;
-<<<<<<< HEAD
-=======
-import org.apache.drill.exec.record.vector.SelectionVector2;
-import org.apache.drill.exec.record.vector.SelectionVector4;
-import org.apache.drill.exec.record.vector.ValueVector;
->>>>>>> Build working
+import org.apache.drill.exec.record.selection.SelectionVector2;
+import org.apache.drill.exec.record.selection.SelectionVector4;
 import org.apache.drill.exec.store.RecordReader;
 import org.apache.drill.exec.vector.ValueVector;
 
-<<<<<<< HEAD
-import com.carrotsearch.hppc.IntObjectOpenHashMap;
-import com.carrotsearch.hppc.procedures.IntObjectProcedure;
-=======
 import com.beust.jcommander.internal.Lists;
 import com.beust.jcommander.internal.Maps;
->>>>>>> Build working
+import com.carrotsearch.hppc.procedures.IntObjectProcedure;
 
 /**
  * Record batch used for a particular scan. Operators against one or more
@@ -56,14 +46,10 @@ import com.beust.jcommander.internal.Maps;
 public class ScanBatch implements RecordBatch {
   static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(ScanBatch.class);
 
-<<<<<<< HEAD
-  private IntObjectOpenHashMap<ValueVector> fields = new IntObjectOpenHashMap<ValueVector>();
-=======
-  final List<ValueVector<?>> vectors = Lists.newLinkedList();
-  final Map<MaterializedField, ValueVector<?>> fieldVectorMap = Maps.newHashMap();
-  
+  final List<ValueVector> vectors = Lists.newLinkedList();
+  final Map<MaterializedField, ValueVector> fieldVectorMap = Maps.newHashMap();
+
   private VectorHolder holder = new VectorHolder(vectors);
->>>>>>> Build working
   private BatchSchema schema;
   private int recordCount;
   private boolean schemaChanged = true;
@@ -72,11 +58,11 @@ public class ScanBatch implements RecordBatch {
   private RecordReader currentReader;
   private final Mutator mutator = new Mutator();
 
-  public ScanBatch(FragmentContext context, Iterator<RecordReader> readers)
-      throws ExecutionSetupException {
+  public ScanBatch(FragmentContext context, Iterator<RecordReader> readers) throws ExecutionSetupException {
     this.context = context;
     this.readers = readers;
-    if (!readers.hasNext()) throw new ExecutionSetupException("A scan batch must contain at least one reader.");
+    if (!readers.hasNext())
+      throw new ExecutionSetupException("A scan batch must contain at least one reader.");
     this.currentReader = readers.next();
     this.currentReader.setup(mutator);
   }
@@ -107,33 +93,11 @@ public class ScanBatch implements RecordBatch {
   }
 
   private void releaseAssets() {
-<<<<<<< HEAD
-    fields.forEach(new IntObjectProcedure<ValueVector>() {
-      @Override
-      public void apply(int key, ValueVector value) {
-        value.close();
-      }
-    });
-  }
-
-  @SuppressWarnings("unchecked")
-  @Override
-  public <T extends ValueVector> T getValueVector(int fieldId, Class<T> clazz) throws InvalidValueAccessor {
-    if (fields.containsKey(fieldId)) throw new InvalidValueAccessor(String.format("Unknown value accesor for field id %d."));
-    ValueVector vector = this.fields.lget();
-    if (vector.getClass().isAssignableFrom(clazz)) {
-      return (T) vector;
-    } else {
-      throw new InvalidValueAccessor(String.format(
-          "You requested a field accessor of type %s for field id %d but the actual type was %s.",
-          clazz.getCanonicalName(), fieldId, vector.getClass().getCanonicalName()));
-=======
-    for(ValueVector<?> v : vectors){
+    for (ValueVector v : vectors) {
       v.close();
->>>>>>> Build working
     }
   }
-  
+
   @Override
   public IterOutcome next() {
     while ((recordCount = currentReader.next()) == 0) {
@@ -161,7 +125,6 @@ public class ScanBatch implements RecordBatch {
     }
   }
 
-  
   @Override
   public SelectionVector2 getSelectionVector2() {
     throw new UnsupportedOperationException();
@@ -178,37 +141,24 @@ public class ScanBatch implements RecordBatch {
   }
 
   @Override
-  public <T extends ValueVector<T>> T getValueVectorById(int fieldId, Class<?> clazz) {
+  public <T extends ValueVector> T getValueVectorById(int fieldId, Class<?> clazz) {
     return holder.getValueVector(fieldId, clazz);
   }
 
-
   private class Mutator implements OutputMutator {
     private SchemaBuilder builder = BatchSchema.newBuilder();
-    
-    public void removeField(MaterializedField field) throws SchemaChangeException {
-      schemaChanged();
-<<<<<<< HEAD
-      ValueVector v = fields.remove(fieldId);
-      if (v == null) throw new SchemaChangeException("Failure attempting to remove an unknown field.");
-      v.close();
-    }
 
-    public void addField(int fieldId, ValueVector vector) {
+    public void removeField(MaterializedField field) throws SchemaChangeException {
       schemaChanged();
-      ValueVector v = fields.put(fieldId, vector);
-      vector.getField();
-=======
-      ValueVector<?> vector = fieldVectorMap.remove(field);
+      ValueVector vector = fieldVectorMap.remove(field);
       if (vector == null) throw new SchemaChangeException("Failure attempting to remove an unknown field.");
       vectors.remove(vector);
       vector.close();
     }
 
-    public void addField(ValueVector<?> vector) {
+    public void addField(ValueVector vector) {
       vectors.add(vector);
       fieldVectorMap.put(vector.getField(), vector);
->>>>>>> Build working
       builder.addField(vector.getField());
     }
 
@@ -224,5 +174,5 @@ public class ScanBatch implements RecordBatch {
   public WritableBatch getWritableBatch() {
     return WritableBatch.get(this.getRecordCount(), vectors);
   }
-  
+
 }

http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/3d41be41/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/VectorHolder.java
----------------------------------------------------------------------
diff --git a/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/VectorHolder.java b/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/VectorHolder.java
index 4209daa..65a7365 100644
--- a/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/VectorHolder.java
+++ b/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/VectorHolder.java
@@ -4,29 +4,29 @@ import java.util.List;
 
 import org.apache.drill.common.expression.SchemaPath;
 import org.apache.drill.exec.record.RecordBatch.TypedFieldId;
-import org.apache.drill.exec.record.vector.ValueVector;
+import org.apache.drill.exec.vector.ValueVector;
 
 public class VectorHolder {
   static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(VectorHolder.class);
   
-  private List<ValueVector<?>> vectors;
+  private List<ValueVector> vectors;
 
-  public VectorHolder(List<ValueVector<?>> vectors) {
+  public VectorHolder(List<ValueVector> vectors) {
     super();
     this.vectors = vectors;
   }
   
   public TypedFieldId getValueVector(SchemaPath path) {
     for(int i =0; i < vectors.size(); i++){
-      ValueVector<?> vv = vectors.get(i);
+      ValueVector vv = vectors.get(i);
       if(vv.getField().matches(path)) return new TypedFieldId(vv.getField().getType(), i); 
     }
     return null;
   }
   
   @SuppressWarnings("unchecked")
-  public <T extends ValueVector<T>> T getValueVector(int fieldId, Class<?> clazz) {
-    ValueVector<?> v = vectors.get(fieldId);
+  public <T extends ValueVector> T getValueVector(int fieldId, Class<?> clazz) {
+    ValueVector v = vectors.get(fieldId);
     assert v != null;
     if (v.getClass() != clazz){
       logger.warn(String.format(

http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/3d41be41/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/WireRecordBatch.java
----------------------------------------------------------------------
diff --git a/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/WireRecordBatch.java b/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/WireRecordBatch.java
index 7b2a533..d2b8bfd 100644
--- a/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/WireRecordBatch.java
+++ b/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/WireRecordBatch.java
@@ -17,26 +17,20 @@
  ******************************************************************************/
 package org.apache.drill.exec.physical.impl;
 
-<<<<<<< HEAD
-=======
 import org.apache.drill.common.expression.SchemaPath;
->>>>>>> Build working
 import org.apache.drill.exec.exception.SchemaChangeException;
 import org.apache.drill.exec.ops.FragmentContext;
 import org.apache.drill.exec.proto.UserBitShared.RecordBatchDef;
 import org.apache.drill.exec.record.BatchSchema;
+import org.apache.drill.exec.record.InvalidValueAccessor;
 import org.apache.drill.exec.record.RawFragmentBatch;
 import org.apache.drill.exec.record.RawFragmentBatchProvider;
 import org.apache.drill.exec.record.RecordBatch;
 import org.apache.drill.exec.record.RecordBatchLoader;
 import org.apache.drill.exec.record.WritableBatch;
-<<<<<<< HEAD
+import org.apache.drill.exec.record.selection.SelectionVector2;
+import org.apache.drill.exec.record.selection.SelectionVector4;
 import org.apache.drill.exec.vector.ValueVector;
-=======
-import org.apache.drill.exec.record.vector.SelectionVector2;
-import org.apache.drill.exec.record.vector.SelectionVector4;
-import org.apache.drill.exec.record.vector.ValueVector;
->>>>>>> Build working
 
 public class WireRecordBatch implements RecordBatch{
   static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(WireRecordBatch.class);
@@ -90,14 +84,9 @@ public class WireRecordBatch implements RecordBatch{
   }
 
   @Override
-<<<<<<< HEAD
-  public <T extends ValueVector> T getValueVector(int fieldId, Class<T> clazz) throws InvalidValueAccessor {
-=======
-  public <T extends ValueVector<T>> T getValueVectorById(int fieldId, Class<?> clazz) {
->>>>>>> Build working
+  public <T extends ValueVector> T getValueVectorById(int fieldId, Class<?> clazz){
     return batchLoader.getValueVector(fieldId, clazz);
   }
-
   
   @Override
   public IterOutcome next() {

http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/3d41be41/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/filter/EvaluationPredicate.java
----------------------------------------------------------------------
diff --git a/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/filter/EvaluationPredicate.java b/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/filter/EvaluationPredicate.java
index 3176c41..862e42c 100644
--- a/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/filter/EvaluationPredicate.java
+++ b/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/filter/EvaluationPredicate.java
@@ -1,6 +1,6 @@
 package org.apache.drill.exec.physical.impl.filter;
 
-import org.apache.drill.exec.record.vector.SelectionVector2;
+import org.apache.drill.exec.record.selection.SelectionVector2;
 
 public class EvaluationPredicate {
   private SelectionVector2 vector;

http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/3d41be41/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/filter/ExampleFilter.java
----------------------------------------------------------------------
diff --git a/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/filter/ExampleFilter.java b/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/filter/ExampleFilter.java
index c4a4032..85f598f 100644
--- a/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/filter/ExampleFilter.java
+++ b/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/filter/ExampleFilter.java
@@ -22,13 +22,11 @@ import org.apache.drill.common.expression.SchemaPath;
 import org.apache.drill.exec.exception.SchemaChangeException;
 import org.apache.drill.exec.ops.FragmentContext;
 import org.apache.drill.exec.record.BatchSchema;
-import org.apache.drill.exec.record.InvalidValueAccessor;
 import org.apache.drill.exec.record.RecordBatch;
-import org.apache.drill.exec.record.RecordBatch.TypedFieldId;
 import org.apache.drill.exec.record.WritableBatch;
-import org.apache.drill.exec.record.vector.SelectionVector2;
-import org.apache.drill.exec.record.vector.SelectionVector4;
-import org.apache.drill.exec.record.vector.ValueVector;
+import org.apache.drill.exec.record.selection.SelectionVector2;
+import org.apache.drill.exec.record.selection.SelectionVector4;
+import org.apache.drill.exec.vector.ValueVector;
 
 public class ExampleFilter implements RecordBatch {
   static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(ExampleFilter.class);
@@ -83,7 +81,7 @@ public class ExampleFilter implements RecordBatch {
   }
 
   @Override
-  public <T extends ValueVector<T>> T getValueVectorById(int fieldId, Class<?> vvClass) {
+  public <T extends ValueVector> T getValueVectorById(int fieldId, Class<?> vvClass) {
     return null;
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/3d41be41/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/filter/FilterTemplate.java
----------------------------------------------------------------------
diff --git a/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/filter/FilterTemplate.java b/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/filter/FilterTemplate.java
index d2983ad..216bfec 100644
--- a/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/filter/FilterTemplate.java
+++ b/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/filter/FilterTemplate.java
@@ -1,7 +1,7 @@
 package org.apache.drill.exec.physical.impl.filter;
 
 import org.apache.drill.exec.record.RecordBatch;
-import org.apache.drill.exec.record.vector.SelectionVector2;
+import org.apache.drill.exec.record.selection.SelectionVector2;
 
 public abstract class FilterTemplate {
   static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(FilterTemplate.class);

http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/3d41be41/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/project/ProjectRecordBatch.java
----------------------------------------------------------------------
diff --git a/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/project/ProjectRecordBatch.java b/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/project/ProjectRecordBatch.java
index 7a3fec1..3d1e3f7 100644
--- a/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/project/ProjectRecordBatch.java
+++ b/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/project/ProjectRecordBatch.java
@@ -28,12 +28,14 @@ import org.apache.drill.exec.record.BatchSchema.SelectionVectorMode;
 import org.apache.drill.exec.record.MaterializedField;
 import org.apache.drill.exec.record.RecordBatch;
 import org.apache.drill.exec.record.SchemaBuilder;
+import org.apache.drill.exec.record.TransferPair;
 import org.apache.drill.exec.record.WritableBatch;
-import org.apache.drill.exec.record.vector.SelectionVector2;
-import org.apache.drill.exec.record.vector.SelectionVector4;
-import org.apache.drill.exec.record.vector.TypeHelper;
-import org.apache.drill.exec.record.vector.ValueVector;
-
+import org.apache.drill.exec.record.selection.SelectionVector2;
+import org.apache.drill.exec.record.selection.SelectionVector4;
+import org.apache.drill.exec.vector.AllocationHelper;
+import org.apache.drill.exec.vector.NonRepeatedMutator;
+import org.apache.drill.exec.vector.TypeHelper;
+import org.apache.drill.exec.vector.ValueVector;
 
 import com.google.common.base.Preconditions;
 import com.google.common.collect.Lists;
@@ -46,8 +48,8 @@ public class ProjectRecordBatch implements RecordBatch{
   private final FragmentContext context;
   private BatchSchema outSchema;
   private Projector projector;
-  private List<ValueVector<?>> allocationVectors;
-  private List<ValueVector<?>> outputVectors;
+  private List<ValueVector> allocationVectors;
+  private List<ValueVector> outputVectors;
   private VectorHolder vh;
   
   
@@ -95,7 +97,7 @@ public class ProjectRecordBatch implements RecordBatch{
   }
 
   @Override
-  public <T extends ValueVector<T>> T getValueVectorById(int fieldId, Class<?> clazz) {
+  public <T extends ValueVector> T getValueVectorById(int fieldId, Class<?> clazz) {
     return vh.getValueVector(fieldId, clazz);
   }
 
@@ -121,12 +123,17 @@ public class ProjectRecordBatch implements RecordBatch{
       // fall through.
     case OK:
       int recordCount = incoming.getRecordCount();
-      for(ValueVector<?> v : this.allocationVectors){
-        v.allocateNew(recordCount);
+      for(ValueVector v : this.allocationVectors){
+        AllocationHelper.allocate(v, recordCount, 50);
       }
       projector.projectRecords(recordCount, 0);
-      for(ValueVector<?> v : this.outputVectors){
-        v.setRecordCount(recordCount);
+      for(ValueVector v : this.outputVectors){
+        ValueVector.Mutator m = v.getMutator();
+        if(m instanceof NonRepeatedMutator){
+          ((NonRepeatedMutator) m).setValueCount(recordCount);
+        }else{
+          throw new UnsupportedOperationException();
+        }
       }
       return upstream; // change if upstream changed, otherwise normal.
     default:
@@ -138,7 +145,7 @@ public class ProjectRecordBatch implements RecordBatch{
   private Projector createNewProjector() throws SchemaChangeException{
     this.allocationVectors = Lists.newArrayList();
     if(outputVectors != null){
-      for(ValueVector<?> v : outputVectors){
+      for(ValueVector v : outputVectors){
         v.close();
       }
     }
@@ -146,7 +153,7 @@ public class ProjectRecordBatch implements RecordBatch{
     this.vh = new VectorHolder(outputVectors);
     final List<NamedExpression> exprs = pop.getExprs();
     final ErrorCollector collector = new ErrorCollectorImpl();
-    final List<TransferPairing<?>> transfers = Lists.newArrayList();
+    final List<TransferPair> transfers = Lists.newArrayList();
     
     final CodeGenerator<Projector> cg = new CodeGenerator<Projector>(Projector.TEMPLATE_DEFINITION, context.getFunctionRegistry());
     
@@ -161,15 +168,15 @@ public class ProjectRecordBatch implements RecordBatch{
       // add value vector to transfer if direct reference and this is allowed, otherwise, add to evaluation stack.
       if(expr instanceof ValueVectorReadExpression && incoming.getSchema().getSelectionVector() == SelectionVectorMode.NONE){
         ValueVectorReadExpression vectorRead = (ValueVectorReadExpression) expr;
-        ValueVector<?> vvIn = incoming.getValueVectorById(vectorRead.getFieldId(), TypeHelper.getValueVectorClass(vectorRead.getMajorType()));
+        ValueVector vvIn = incoming.getValueVectorById(vectorRead.getFieldId(), TypeHelper.getValueVectorClass(vectorRead.getMajorType().getMinorType(), vectorRead.getMajorType().getMode()));
         Preconditions.checkNotNull(incoming);
 
-        TransferPairing<?> tp = vvIn.getTransferPair(outputField);
+        TransferPair tp = vvIn.getTransferPair();
         transfers.add(tp);
         outputVectors.add(tp.getTo());
       }else{
         // need to do evaluation.
-        ValueVector<?> vector = TypeHelper.getNewVector(outputField, context.getAllocator());
+        ValueVector vector = TypeHelper.getNewVector(outputField, context.getAllocator());
         allocationVectors.add(vector);
         outputVectors.add(vector);
         ValueVectorWriteExpression write = new ValueVectorWriteExpression(outputVectors.size() - 1, expr);
@@ -179,7 +186,7 @@ public class ProjectRecordBatch implements RecordBatch{
     }
     
     SchemaBuilder bldr = BatchSchema.newBuilder().setSelectionVectorMode(SelectionVectorMode.NONE);
-    for(ValueVector<?> v : outputVectors){
+    for(ValueVector v : outputVectors){
       bldr.addField(v.getField());
     }
     this.outSchema = bldr.build();

http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/3d41be41/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/project/Projector.java
----------------------------------------------------------------------
diff --git a/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/project/Projector.java b/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/project/Projector.java
index 8f22b40..2787f0c 100644
--- a/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/project/Projector.java
+++ b/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/project/Projector.java
@@ -6,10 +6,11 @@ import org.apache.drill.exec.compile.TemplateClassDefinition;
 import org.apache.drill.exec.exception.SchemaChangeException;
 import org.apache.drill.exec.ops.FragmentContext;
 import org.apache.drill.exec.record.RecordBatch;
+import org.apache.drill.exec.record.TransferPair;
 
 public interface Projector {
 
-  public abstract void setup(FragmentContext context, RecordBatch incoming,  RecordBatch outgoing, List<TransferPairing<?>> transfers)  throws SchemaChangeException;
+  public abstract void setup(FragmentContext context, RecordBatch incoming,  RecordBatch outgoing, List<TransferPair> transfers)  throws SchemaChangeException;
 
   
   public abstract int projectRecords(int recordCount, int firstOutputIndex);

http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/3d41be41/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/project/ProjectorTemplate.java
----------------------------------------------------------------------
diff --git a/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/project/ProjectorTemplate.java b/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/project/ProjectorTemplate.java
index 1163fef..486c7b0 100644
--- a/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/project/ProjectorTemplate.java
+++ b/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/project/ProjectorTemplate.java
@@ -6,15 +6,16 @@ import org.apache.drill.exec.exception.SchemaChangeException;
 import org.apache.drill.exec.ops.FragmentContext;
 import org.apache.drill.exec.record.BatchSchema.SelectionVectorMode;
 import org.apache.drill.exec.record.RecordBatch;
-import org.apache.drill.exec.record.vector.SelectionVector2;
-import org.apache.drill.exec.record.vector.SelectionVector4;
+import org.apache.drill.exec.record.TransferPair;
+import org.apache.drill.exec.record.selection.SelectionVector2;
+import org.apache.drill.exec.record.selection.SelectionVector4;
 
 import com.google.common.collect.ImmutableList;
 
 public abstract class ProjectorTemplate implements Projector {
   static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(ProjectorTemplate.class);
   
-  private ImmutableList<TransferPairing<?>> transfers;
+  private ImmutableList<TransferPair> transfers;
   private SelectionVector2 vector2;
   private SelectionVector4 vector4;
   private SelectionVectorMode svMode;
@@ -39,7 +40,7 @@ public abstract class ProjectorTemplate implements Projector {
       
     case NONE:
       
-      for(TransferPairing<?> t : transfers){
+      for(TransferPair t : transfers){
         t.transfer();
       }
       final int countN = recordCount;
@@ -55,7 +56,7 @@ public abstract class ProjectorTemplate implements Projector {
   }
 
   @Override
-  public final void setup(FragmentContext context, RecordBatch incoming, RecordBatch outgoing, List<TransferPairing<?>> transfers)  throws SchemaChangeException{
+  public final void setup(FragmentContext context, RecordBatch incoming, RecordBatch outgoing, List<TransferPair> transfers)  throws SchemaChangeException{
 
     this.svMode = incoming.getSchema().getSelectionVector(); 
     switch(svMode){

http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/3d41be41/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/project/TransferPairing.java
----------------------------------------------------------------------
diff --git a/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/project/TransferPairing.java b/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/project/TransferPairing.java
deleted file mode 100644
index 2b4ac81..0000000
--- a/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/physical/impl/project/TransferPairing.java
+++ /dev/null
@@ -1,35 +0,0 @@
-package org.apache.drill.exec.physical.impl.project;
-
-import org.apache.drill.exec.record.vector.ValueVector;
-
-public class TransferPairing<T extends ValueVector<T>> {
-  
-  static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(TransferPairing.class);
-  
-  final T from;
-  final T to;
-  
-  protected TransferPairing(T from, T to) {
-    super();
-    this.from = from;
-    this.to = to;
-  }
-
-  public void transfer(){
-    from.transferTo(to);
-  }
-  
-  public static <T extends ValueVector<T>> TransferPairing<T> getTransferPairing(T from, T to){
-    return new TransferPairing<T>(from, to);
-  }
-
-  public T getFrom() {
-    return from;
-  }
-
-  public T getTo() {
-    return to;
-  }
-  
-  
-}

http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/3d41be41/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/record/MaterializedField.java
----------------------------------------------------------------------
diff --git a/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/record/MaterializedField.java b/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/record/MaterializedField.java
index 6cf7087..732dab3 100644
--- a/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/record/MaterializedField.java
+++ b/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/record/MaterializedField.java
@@ -26,7 +26,7 @@ import org.apache.drill.common.types.TypeProtos.MajorType;
 import org.apache.drill.exec.proto.SchemaDefProtos.FieldDef;
 import org.apache.drill.exec.proto.SchemaDefProtos.NamePart;
 import org.apache.drill.exec.proto.SchemaDefProtos.NamePart.Type;
-import org.apache.drill.exec.record.vector.TypeHelper;
+import org.apache.drill.exec.vector.TypeHelper;
 
 public class MaterializedField{
   private final FieldDef def;
@@ -113,7 +113,8 @@ public class MaterializedField{
       throw new UnsupportedOperationException();
     }
     return new MaterializedField(def.toBuilder().setMajorType(mt.toBuilder().setMode(newDataMode).build()).build());
-
+  }
+  
   public Class<?> getValueClass() {
     return TypeHelper.getValueVectorClass(getType().getMinorType(), getDataMode());
   }

http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/3d41be41/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/record/RecordBatch.java
----------------------------------------------------------------------
diff --git a/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/record/RecordBatch.java b/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/record/RecordBatch.java
index 0edb93e..650a148 100644
--- a/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/record/RecordBatch.java
+++ b/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/record/RecordBatch.java
@@ -20,9 +20,9 @@ package org.apache.drill.exec.record;
 import org.apache.drill.common.expression.SchemaPath;
 import org.apache.drill.common.types.TypeProtos.MajorType;
 import org.apache.drill.exec.ops.FragmentContext;
-import org.apache.drill.exec.record.vector.SelectionVector2;
-import org.apache.drill.exec.record.vector.SelectionVector4;
-import org.apache.drill.exec.record.vector.ValueVector;
+import org.apache.drill.exec.record.selection.SelectionVector2;
+import org.apache.drill.exec.record.selection.SelectionVector4;
+import org.apache.drill.exec.vector.ValueVector;
 
 /**
  * A record batch contains a set of field values for a particular range of records. In the case of a record batch
@@ -88,7 +88,7 @@ public interface RecordBatch {
   public abstract TypedFieldId getValueVectorId(SchemaPath path);
   
   
-  public abstract <T extends ValueVector<T>> T getValueVectorById(int fieldId, Class<?> clazz);
+  public abstract <T extends ValueVector> T getValueVectorById(int fieldId, Class<?> clazz);
 
   /**
    * Update the data in each Field reading interface for the next range of records. Once a RecordBatch returns an

http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/3d41be41/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/record/RecordBatchLoader.java
----------------------------------------------------------------------
diff --git a/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/record/RecordBatchLoader.java b/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/record/RecordBatchLoader.java
index c3db9f0..e2a1648 100644
--- a/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/record/RecordBatchLoader.java
+++ b/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/record/RecordBatchLoader.java
@@ -30,19 +30,17 @@ import org.apache.drill.exec.proto.SchemaDefProtos.FieldDef;
 import org.apache.drill.exec.proto.UserBitShared.FieldMetadata;
 import org.apache.drill.exec.proto.UserBitShared.RecordBatchDef;
 import org.apache.drill.exec.record.RecordBatch.TypedFieldId;
-import org.apache.drill.exec.record.vector.TypeHelper;
-import org.apache.drill.exec.record.vector.ValueVector;
+import org.apache.drill.exec.vector.TypeHelper;
+import org.apache.drill.exec.vector.ValueVector;
 
 import com.beust.jcommander.internal.Lists;
 import com.beust.jcommander.internal.Maps;
-import com.carrotsearch.hppc.IntObjectOpenHashMap;
-import com.carrotsearch.hppc.cursors.IntObjectCursor;
 import com.google.common.collect.ImmutableList;
 
-public class RecordBatchLoader implements Iterable<ValueVector<?>>{
+public class RecordBatchLoader implements Iterable<ValueVector>{
   static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(RecordBatchLoader.class);
 
-  private List<ValueVector<?>> vectors = Lists.newArrayList();
+  private List<ValueVector> vectors = Lists.newArrayList();
   private final BufferAllocator allocator;
   private int recordCount; 
   private BatchSchema schema;
@@ -67,19 +65,19 @@ public class RecordBatchLoader implements Iterable<ValueVector<?>>{
     this.recordCount = def.getRecordCount();
     boolean schemaChanged = false;
 
-    Map<MaterializedField, ValueVector<?>> oldFields = Maps.newHashMap();
-    for(ValueVector<?> v : this.vectors){
+    Map<MaterializedField, ValueVector> oldFields = Maps.newHashMap();
+    for(ValueVector v : this.vectors){
       oldFields.put(v.getField(), v);
     }
     
-    List<ValueVector<?>> newVectors = Lists.newArrayList();
+    List<ValueVector> newVectors = Lists.newArrayList();
 
     List<FieldMetadata> fields = def.getFieldList();
     
     int bufOffset = 0;
     for (FieldMetadata fmd : fields) {
       FieldDef fieldDef = fmd.getDef();
-      ValueVector<?> v = oldFields.remove(fieldDef);
+      ValueVector v = oldFields.remove(fieldDef);
       if(v != null){
         newVectors.add(v);
         continue;
@@ -90,21 +88,19 @@ public class RecordBatchLoader implements Iterable<ValueVector<?>>{
       MaterializedField m = new MaterializedField(fieldDef);
       v = TypeHelper.getNewVector(m, allocator);
       v.load(fmd, buf.slice(bufOffset, fmd.getBufferLength()));
-      newVectors.put(fieldDef.getFieldId(), v);
-      v.setTo(fmd, buf.slice(bufOffset, fmd.getBufferLength()));
       newVectors.add(v);
     }
     
     if(!oldFields.isEmpty()){
       schemaChanged = true;
-      for(ValueVector<?> v : oldFields.values()){
+      for(ValueVector v : oldFields.values()){
         v.close();
       }
     }
     
     // rebuild the schema.
     SchemaBuilder b = BatchSchema.newBuilder();
-    for(ValueVector<?> v : newVectors){
+    for(ValueVector v : newVectors){
       b.addField(v.getField());
     }
     b.setSelectionVectorMode(BatchSchema.SelectionVectorMode.NONE);
@@ -116,15 +112,15 @@ public class RecordBatchLoader implements Iterable<ValueVector<?>>{
 
   public TypedFieldId getValueVector(SchemaPath path) {
     for(int i =0; i < vectors.size(); i++){
-      ValueVector<?> vv = vectors.get(i);
+      ValueVector vv = vectors.get(i);
       if(vv.getField().matches(path)) return new TypedFieldId(vv.getField().getType(), i); 
     }
     return null;
   }
   
   @SuppressWarnings("unchecked")
-  public <T extends ValueVector<T>> T getValueVector(int fieldId, Class<?> clazz) {
-    ValueVector<?> v = vectors.get(fieldId);
+  public <T extends ValueVector> T getValueVector(int fieldId, Class<?> clazz) {
+    ValueVector v = vectors.get(fieldId);
     assert v != null;
     if (v.getClass() != clazz){
       logger.warn(String.format(
@@ -145,7 +141,7 @@ public class RecordBatchLoader implements Iterable<ValueVector<?>>{
   }
 
   @Override
-  public Iterator<ValueVector<?>> iterator() {
+  public Iterator<ValueVector> iterator() {
     return this.vectors.iterator();
   }
 

http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/3d41be41/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/record/TransferPair.java
----------------------------------------------------------------------
diff --git a/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/record/TransferPair.java b/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/record/TransferPair.java
new file mode 100644
index 0000000..a90e2d8
--- /dev/null
+++ b/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/record/TransferPair.java
@@ -0,0 +1,8 @@
+package org.apache.drill.exec.record;
+
+import org.apache.drill.exec.vector.ValueVector;
+
+public interface TransferPair {
+  public void transfer();
+  public ValueVector getTo();
+}

http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/3d41be41/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/record/WritableBatch.java
----------------------------------------------------------------------
diff --git a/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/record/WritableBatch.java b/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/record/WritableBatch.java
index 2e1754c..8335e91 100644
--- a/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/record/WritableBatch.java
+++ b/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/record/WritableBatch.java
@@ -25,8 +25,6 @@ import org.apache.drill.exec.proto.UserBitShared.FieldMetadata;
 import org.apache.drill.exec.proto.UserBitShared.RecordBatchDef;
 import org.apache.drill.exec.vector.ValueVector;
 
-import com.carrotsearch.hppc.IntObjectOpenHashMap;
-import com.carrotsearch.hppc.procedures.IntObjectProcedure;
 import com.google.common.collect.Lists;
 
 /**
@@ -58,20 +56,20 @@ public class WritableBatch {
     return buffers;
   }
 
-  public static WritableBatch get(int recordCount, List<ValueVector<?>> vectors){
+  public static WritableBatch get(int recordCount, List<ValueVector> vectors){
     
     List<ByteBuf> buffers = Lists.newArrayList();
     List<FieldMetadata> metadata = Lists.newArrayList();
     
 
-    for(ValueVector<?> vv : vectors){
+    for(ValueVector vv : vectors){
       metadata.add(vv.getMetadata());
       for(ByteBuf b : vv.getBuffers()){
         buffers.add(b);
         b.retain();
       }
       // allocate new buffer to release hold on old buffer.
-      vv.allocateNew(vv.capacity());
+      vv.clear();
     }
 
     RecordBatchDef batchDef = RecordBatchDef.newBuilder().addAllField(metadata).setRecordCount(recordCount).build();

http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/3d41be41/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/record/selection/SelectionVector2.java
----------------------------------------------------------------------
diff --git a/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/record/selection/SelectionVector2.java b/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/record/selection/SelectionVector2.java
new file mode 100644
index 0000000..cdc136e
--- /dev/null
+++ b/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/record/selection/SelectionVector2.java
@@ -0,0 +1,49 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+package org.apache.drill.exec.record.selection;
+
+import io.netty.buffer.ByteBuf;
+
+import org.apache.drill.exec.memory.BufferAllocator;
+import org.apache.drill.exec.record.DeadBuf;
+
+/**
+ * A selection vector that fronts, at most, a
+ */
+public class SelectionVector2{
+  static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(SelectionVector2.class);
+
+  private final BufferAllocator allocator;
+  private ByteBuf buffer = DeadBuf.DEAD_BUFFER;
+
+  public SelectionVector2(BufferAllocator allocator) {
+    this.allocator = allocator;
+  }
+
+  public int getCount(){
+    return -1;
+  }
+
+  public int getIndex(int directIndex){
+    return buffer.getChar(directIndex);
+  }
+
+  public void setIndex(int directIndex, char value){
+    buffer.setChar(directIndex, value);
+  }
+}

http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/3d41be41/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/record/selection/SelectionVector4.java
----------------------------------------------------------------------
diff --git a/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/record/selection/SelectionVector4.java b/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/record/selection/SelectionVector4.java
new file mode 100644
index 0000000..1f3874f
--- /dev/null
+++ b/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/record/selection/SelectionVector4.java
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ ******************************************************************************/
+
+package org.apache.drill.exec.record.selection;
+
+import io.netty.buffer.ByteBuf;
+
+import org.apache.drill.exec.memory.BufferAllocator;
+import org.apache.drill.exec.record.DeadBuf;
+
+public class SelectionVector4 {
+  static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(SelectionVector4.class);
+
+  private final BufferAllocator allocator;
+  private ByteBuf buffer = DeadBuf.DEAD_BUFFER;
+
+  public SelectionVector4(BufferAllocator allocator) {
+    this.allocator = allocator;
+  }
+
+  public int getCount(){
+    return -1;
+  }
+
+
+}

http://git-wip-us.apache.org/repos/asf/incubator-drill/blob/3d41be41/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/record/vector/BitUtil.java
----------------------------------------------------------------------
diff --git a/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/record/vector/BitUtil.java b/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/record/vector/BitUtil.java
deleted file mode 100644
index 4a3ae2f..0000000
--- a/sandbox/prototype/exec/java-exec/src/main/java/org/apache/drill/exec/record/vector/BitUtil.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*******************************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- * 
- * http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- ******************************************************************************/
-package org.apache.drill.exec.record.vector;  // from org.apache.solr.util rev 555343
-
-import io.netty.buffer.ByteBuf;
-
-
-/**  A variety of high efficiency bit twiddling routines.
- * @lucene.internal
- */
-public final class BitUtil {
-
-  private BitUtil() {} // no instance
-
-  // The pop methods used to rely on bit-manipulation tricks for speed but it
-  // turns out that it is faster to use the Long.bitCount method (which is an
-  // intrinsic since Java 6u18) in a naive loop, see LUCENE-2221
-
-  /** Returns the number of set bits in an array of longs. */
-  public static long pop_array(ByteBuf arr, int wordOffset, int numWords) {
-    long popCount = 0;
-    for (int i = wordOffset, end = wordOffset + numWords; i < end; i+=8) {
-      popCount += Long.bitCount(arr.getLong(i));
-    }
-    return popCount;
-  }
-
-  /** Returns the popcount or cardinality of the two sets after an intersection.
-   *  Neither array is modified. */
-  public static long pop_intersect(ByteBuf arr1, ByteBuf arr2, int wordOffset, int numWords) {
-    long popCount = 0;
-    for (int i = wordOffset, end = wordOffset + numWords; i < end; i+=8) {
-      popCount += Long.bitCount(arr1.getLong(i) & arr2.getLong(i));
-    }
-    return popCount;
-  }
-
-   /** Returns the popcount or cardinality of the union of two sets.
-    *  Neither array is modified. */
-   public static long pop_union(ByteBuf arr1, ByteBuf arr2, int wordOffset, int numWords) {
-     long popCount = 0;
-     for (int i = wordOffset, end = wordOffset + numWords; i < end; i+=8) {
-       popCount += Long.bitCount(arr1.getLong(i) | arr2.getLong(i));
-     }
-     return popCount;
-   }
-
-  /** Returns the popcount or cardinality of A & ~B.
-   *  Neither array is modified. */
-  public static long pop_andnot(ByteBuf arr1, ByteBuf arr2, int wordOffset, int numWords) {
-    long popCount = 0;
-    for (int i = wordOffset, end = wordOffset + numWords; i < end; i+=8) {
-      popCount += Long.bitCount(arr1.getLong(i) & ~arr2.getLong(i));
-    }
-    return popCount;
-  }
-
-  /** Returns the popcount or cardinality of A ^ B
-    * Neither array is modified. */
-  public static long pop_xor(ByteBuf arr1, ByteBuf arr2, int wordOffset, int numWords) {
-    long popCount = 0;
-    for (int i = wordOffset, end = wordOffset + numWords; i < end; i+=8) {
-      popCount += Long.bitCount(arr1.getLong(i) ^ arr2.getLong(i));
-    }
-    return popCount;
-  }
-
-  /** returns the next highest power of two, or the current value if it's already a power of two or zero*/
-  public static int nextHighestPowerOfTwo(int v) {
-    v--;
-    v |= v >> 1;
-    v |= v >> 2;
-    v |= v >> 4;
-    v |= v >> 8;
-    v |= v >> 16;
-    v++;
-    return v;
-  }
-
-  /** returns the next highest power of two, or the current value if it's already a power of two or zero*/
-   public static long nextHighestPowerOfTwo(long v) {
-    v--;
-    v |= v >> 1;
-    v |= v >> 2;
-    v |= v >> 4;
-    v |= v >> 8;
-    v |= v >> 16;
-    v |= v >> 32;
-    v++;
-    return v;
-  }
-
-}
\ No newline at end of file