Github user jinfengni commented on a diff in the pull request:

    https://github.com/apache/drill/pull/906#discussion_r136188197
  
    --- Diff: 
exec/vector/src/main/java/org/apache/drill/exec/vector/UntypedNullVector.java 
---
    @@ -0,0 +1,267 @@
    +/*
    + * 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.vector;
    +
    +
    +import com.google.common.base.Preconditions;
    +import io.netty.buffer.DrillBuf;
    +import org.apache.drill.exec.memory.BufferAllocator;
    +import org.apache.drill.exec.proto.UserBitShared.SerializedField;
    +import org.apache.drill.exec.record.MaterializedField;
    +import org.apache.drill.exec.record.TransferPair;
    +import org.apache.drill.exec.vector.complex.reader.FieldReader;
    +
    +/** UntypedNullVector is to represent a value vector with {@link 
org.apache.drill.common.types.MinorType.NULL}
    + *  All values in the vector represent two semantic implications: 1) the 
value is unknown, 2) the type is unknown.
    + *  Because of this, we only have to keep track of the number of values in 
value vector,
    + *  and there is no allocated buffer to back up this value vector. 
Therefore, the majority of
    + *  methods in this class is either no-op, or throws {@link 
UnsupportedOperationException}.
    + *
    + */
    +public final class UntypedNullVector extends BaseDataValueVector 
implements FixedWidthVector {
    +  private static final org.slf4j.Logger logger = 
org.slf4j.LoggerFactory.getLogger(UntypedNullVector.class);
    +
    +  /**
    +   * Width of each fixed-width value.
    +   */
    +  public static final int VALUE_WIDTH = 0;
    +
    +  private final Accessor accessor = new Accessor();
    +  private final Mutator mutator = new Mutator();
    +  private int valueCount ;
    +
    +  public UntypedNullVector(MaterializedField field, BufferAllocator 
allocator) {
    +    super(field, allocator);
    +    valueCount = 0;
    +  }
    +
    +  @Override
    +  public FieldReader getReader() { throw new 
UnsupportedOperationException(); }
    +
    +  @Override
    +  public int getBufferSizeFor(final int valueCount) {
    +    return 0;
    +  }
    +
    +  @Override
    +  public int getValueCapacity(){
    +    return Character.MAX_VALUE;
    --- End diff --
    
    Done.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to