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:20:47 GMT
Github user ravipesala commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/1079#discussion_r125154233
  
    --- Diff: core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeLessThanEqualFilterExecuterImpl.java
---
    @@ -91,57 +129,147 @@ private void ifDefaultValueMatchesFilter() {
     
       private boolean isScanRequired(byte[] blockMinValue, byte[][] filterValues) {
         boolean isScanRequired = false;
    -    if (isDimensionPresentInCurrentBlock[0]) {
    -      for (int k = 0; k < filterValues.length; k++) {
    -        // and filter-min should be positive
    -        int minCompare = ByteUtil.UnsafeComparer.INSTANCE.compareTo(filterValues[k],
blockMinValue);
    +    for (int k = 0; k < filterValues.length; k++) {
    +      // and filter-min should be positive
    +      int minCompare = ByteUtil.UnsafeComparer.INSTANCE.compareTo(filterValues[k], blockMinValue);
     
    -        // if any filter applied is not in range of min and max of block
    -        // then since its a less than equal to fiter validate whether the block
    -        // min range is less than equal to applied filter member
    -        if (minCompare >= 0) {
    -          isScanRequired = true;
    -          break;
    -        }
    +      // if any filter applied is not in range of min and max of block
    +      // then since its a less than equal to fiter validate whether the block
    +      // min range is less than equal to applied filter member
    +      if (minCompare >= 0) {
    +        isScanRequired = true;
    +        break;
           }
    -    } else {
    -      isScanRequired = isDefaultValuePresentInFilter;
         }
         return isScanRequired;
       }
     
    +  private boolean isScanRequired(byte[] minValue, byte[][] filterValue,
    +      DataType dataType) {
    +    for (int i = 0; i < filterValue.length; i++) {
    +      if (filterValue[i].length == 0 || minValue.length == 0) {
    +        return isScanRequired(minValue, 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