carbondata-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ravipesala <...@git.apache.org>
Subject [GitHub] carbondata pull request #1079: [WIP]Measure Filter implementation
Date Sat, 01 Jul 2017 04:19:28 GMT
Github user ravipesala commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1079#discussion_r125154219
  
    --- Diff: core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGrtrThanEquaToFilterExecuterImpl.java
---
    @@ -91,67 +131,167 @@ private void ifDefaultValueMatchesFilter() {
     
       private boolean isScanRequired(byte[] blockMaxValue, byte[][] filterValues) {
         boolean isScanRequired = false;
    -    if (isDimensionPresentInCurrentBlock[0]) {
    -      for (int k = 0; k < filterValues.length; k++) {
    -        // filter value should be in range of max and min value i.e
    -        // max>filtervalue>min
    -        // so filter-max should be negative
    -        int maxCompare = ByteUtil.UnsafeComparer.INSTANCE.compareTo(filterValues[k],
blockMaxValue);
    -        // if any filter value is in range than this block needs to be
    -        // scanned less than equal to max range.
    -        if (maxCompare <= 0) {
    -          isScanRequired = true;
    -          break;
    -        }
    +    for (int k = 0; k < filterValues.length; k++) {
    +      // filter value should be in range of max and min value i.e
    +      // max>filtervalue>min
    +      // so filter-max should be negative
    +      int maxCompare = ByteUtil.UnsafeComparer.INSTANCE.compareTo(filterValues[k], blockMaxValue);
    +      // if any filter value is in range than this block needs to be
    +      // scanned less than equal to max range.
    +      if (maxCompare <= 0) {
    +        isScanRequired = true;
    +        break;
           }
    -    } else {
    -      isScanRequired = isDefaultValuePresentInFilter;
         }
         return isScanRequired;
       }
     
    +  private boolean isScanRequired(byte[] maxValue, byte[][] filterValue,
    +      DataType dataType) {
    +    for (int i = 0; i < filterValue.length; i++) {
    +      if (filterValue[i].length == 0 || maxValue.length == 0) {
    +        return isScanRequired(maxValue, filterValue);
    +      }
    +      switch (dataType) {
    --- End diff --
    
    Use existing methods of `DataTypeUtil` and comparator 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