drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amansinha100 <...@git.apache.org>
Subject [GitHub] drill pull request #840: DRILL-5517: Size-aware set methods in value vectors
Date Thu, 29 Jun 2017 15:48:16 GMT
Github user amansinha100 commented on a diff in the pull request:

    https://github.com/apache/drill/pull/840#discussion_r124706419
  
    --- Diff: exec/vector/src/main/codegen/templates/FixedValueVectors.java ---
    @@ -31,68 +31,98 @@
     import org.apache.drill.exec.util.DecimalUtility;
     
     /**
    - * ${minor.class} implements a vector of fixed width values.  Elements in the vector
are accessed
    - * by position, starting from the logical start of the vector.  Values should be pushed
onto the
    - * vector sequentially, but may be randomly accessed.
    - *   The width of each element is ${type.width} byte(s)
    - *   The equivalent Java primitive is '${minor.javaType!type.javaType}'
    + * ${minor.class} implements a vector of fixed width values. Elements in the vector are
accessed
    + * by position, starting from the logical start of the vector. Values should be pushed
onto the
    + * vector sequentially, but may be accessed randomly.
    + * <ul>
    + * <li>The width of each element is {@link #VALUE_WIDTH} (= ${type.width}) byte<#if
type.width != 1>s</#if>.</li>
    + * <li>The equivalent Java primitive is '${minor.javaType!type.javaType}'.</li>
    + * </ul>
      *
      * NB: this class is automatically generated from ${.template_name} and ValueVectorTypes.tdd
using FreeMarker.
      */
    -public final class ${minor.class}Vector extends BaseDataValueVector implements FixedWidthVector{
    +public final class ${minor.class}Vector extends BaseDataValueVector implements FixedWidthVector
{
       private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(${minor.class}Vector.class);
     
    +  /**
    +   * Width of each fixed-width value.
    +   */
    +
    +  public static final int VALUE_WIDTH = ${type.width};
    +
    +  /**
    +   * Maximum number of values that this fixed-width vector can hold
    +   * and stay below the maximum vector size limit. This is the limit
    +   * enforced when the vector is used to hold values in a repeated
    +   * vector.
    +   */
    +
    +  public static final int MAX_VALUE_COUNT = MAX_BUFFER_SIZE / VALUE_WIDTH;
    +
    +  /**
    +   * Maximum number of values that this fixed-width vector can hold
    +   * and stay below the maximum vector size limit and/or stay below
    +   * the maximum row count. This is the limit enforced when the
    +   * vector is used to hold scalar (required or nullable) values.
    +   */
    +
    +  public static final int MAX_SCALAR_COUNT = Math.min(MAX_ROW_COUNT, MAX_VALUE_COUNT);
    --- End diff --
    
    Where is the constant MAX_ROW_COUNT defined ?   (later I saw it defined in the ValueVector
interface...perhaps add a comment here)


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message