[ 
https://issues.apache.org/jira/browse/DRILL-5846?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16299578#comment-16299578
 ] 

ASF GitHub Bot commented on DRILL-5846:
---------------------------------------

Github user paul-rogers commented on a diff in the pull request:

    https://github.com/apache/drill/pull/1060#discussion_r158198205
  
    --- Diff: exec/vector/src/main/codegen/templates/NullableValueVectors.java 
---
    @@ -456,55 +818,191 @@ public void get(int index, 
Nullable${minor.class}Holder holder){
           </#if>
         }
     
    +    /** {@inheritDoc} */
         @Override
         public ${friendlyType} getObject(int index) {
           if (isNull(index)) {
    -        return null;
    -      } else {
    +          return null;
    +      }else{
             return vAccessor.getObject(index);
           }
         }
    -
         <#if minor.class == "Interval" || minor.class == "IntervalDay" || 
minor.class == "IntervalYear">
    +    /** {@inheritDoc} */
         public StringBuilder getAsStringBuilder(int index) {
           if (isNull(index)) {
    -        return null;
    -      } else {
    +          return null;
    +      }else{
             return vAccessor.getAsStringBuilder(index);
           }
         }
    -
         </#if>
    +    /** {@inheritDoc} */
         @Override
         public int getValueCount() {
           return bits.getAccessor().getValueCount();
         }
    +  }
     
    -    public void reset() {}
    +  <#if type.major == "VarLen" && minor.class == "VarChar">
    +  /** Accessor Implementation for vector with only duplicate values */
    +  public final class DupValsOnlyAccessor extends Accessor {
    +    /** {@inheritDoc} */
    +    public byte[] get(int index) {
    +      chkIndex(index);
    +
    +      if (isNull(0)) {
    +          throw new IllegalStateException("Can't get a null value");
    +      }
    +      return vAccessor.get(0);
       }
     
    -  public final class Mutator extends BaseDataValueVector.BaseMutator 
implements NullableVectorDefinitionSetter<#if type.major = "VarLen">, 
VariableWidthVector.VariableWidthMutator</#if> {
    -    private int setCount;
    -    <#if type.major = "VarLen">private int lastSet = -1;</#if>
    +    /** {@inheritDoc} */
    +    @Override
    +    public boolean isNull(int index) {
    +      chkIndex(index);
    +      return bAccessor.get(0) == 0;
    +    }
     
    -    private Mutator() { }
    +    /** {@inheritDoc} */
    +    public int isSet(int index) {
    +      chkIndex(index);
    +      return bAccessor.get(0);
    +    }
     
    -    public ${valuesName} getVectorWithValues(){
    -      return values;
    +    /** {@inheritDoc} */
    +    public long getStartEnd(int index){
    +      chkIndex(index);
    +      return vAccessor.getStartEnd(0);
         }
     
    +    /** {@inheritDoc} */
         @Override
    -    public void setIndexDefined(int index){
    -      bits.getMutator().set(index, 1);
    +    public int getValueLength(int index) {
    +      chkIndex(index);
    +      return values.getAccessor().getValueLength(0);
    +    }
    +
    +    /** {@inheritDoc} */
    +    public void get(int index, Nullable${minor.class}Holder holder) {
    +      chkIndex(index);
    +      vAccessor.get(0, holder);
    +      holder.isSet = bAccessor.get(0);
    +    }
    +
    +    /** {@inheritDoc} */
    +    @Override
    +    public ${friendlyType} getObject(int index) {
    +      if (isNull(index)) {
    +          return null;
    +      }else{
    +        return vAccessor.getObject(0);
    +      }
    +    }
    +
    +    /** {@inheritDoc} */
    +    @Override
    +    public int getValueCount() {
    +      return logicalNumValues;
         }
     
    +    private void chkIndex(int index) {
    +      if (index >= logicalNumValues) {
    +        throw new IndexOutOfBoundsException(String.format("Index [%d], 
number of values [%d]", index, logicalNumValues));
    +      }
    +    }
    +  }
    +  </#if>
    +
    
+//-----------------------------------------------------------------------------
    +// Mutator inner classes
    
+//-----------------------------------------------------------------------------
    +
    +  /** Abstract mutator class */
    +  public abstract class Mutator extends BaseDataValueVector.BaseMutator 
implements NullableVectorDefinitionSetter<#if type.major = "VarLen">, 
VariableWidthVector.VariableWidthMutator</#if> {
    --- End diff --
    
    We should discuss in person. We have two conflicting threads. My PR will 
render mutators obsolete. Yours will double-down on the mutators. I suspect the 
result will be confusion for the other developers.


> Improve Parquet Reader Performance for Flat Data types 
> -------------------------------------------------------
>
>                 Key: DRILL-5846
>                 URL: https://issues.apache.org/jira/browse/DRILL-5846
>             Project: Apache Drill
>          Issue Type: Improvement
>          Components: Storage - Parquet
>    Affects Versions: 1.11.0
>            Reporter: salim achouche
>            Assignee: salim achouche
>              Labels: performance
>             Fix For: 1.13.0
>
>
> The Parquet Reader is a key use-case for Drill. This JIRA is an attempt to 
> further improve the Parquet Reader performance as several users reported that 
> Parquet parsing represents the lion share of the overall query execution. It 
> tracks Flat Data types only as Nested DTs might involve functional and 
> processing enhancements (e.g., a nested column can be seen as a Document; 
> user might want to perform operations scoped at the document level that is no 
> need to span all rows). Another JIRA will be created to handle the nested 
> columns use-case.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to