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

    https://github.com/apache/carbondata/pull/2654#discussion_r214351650
  
    --- Diff: 
core/src/main/java/org/apache/carbondata/core/datastore/TableSpec.java ---
    @@ -91,6 +92,30 @@ private void addMeasures(List<CarbonMeasure> measures) {
         }
       }
     
    +  /**
    +   * No dictionary and complex dimensions of the table
    +   *
    +   * @return
    +   */
    +  public DimensionSpec[] getNoDictAndComplexDimensions() {
    +    List<Integer> noDicOrCompIndexes = new 
ArrayList<>(dimensionSpec.length);
    +    int noDicCount = 0;
    +    for (int i = 0; i < dimensionSpec.length; i++) {
    +      if (dimensionSpec[i].getColumnType() == ColumnType.PLAIN_VALUE
    +          || dimensionSpec[i].getColumnType() == 
ColumnType.COMPLEX_PRIMITIVE
    +          || dimensionSpec[i].getColumnType() == ColumnType.COMPLEX) {
    +        noDicOrCompIndexes.add(i);
    +        noDicCount++;
    +      }
    +    }
    +
    +    DimensionSpec[] dims = new DimensionSpec[noDicCount];
    +    for (int i = 0; i < dims.length; i++) {
    +      dims[i] = dimensionSpec[noDicOrCompIndexes.get(i)];
    +    }
    +    return dims;
    --- End diff --
    
    Avoid the below for loop in this method


---

Reply via email to