You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@carbondata.apache.org by Zhangshunyu <gi...@git.apache.org> on 2016/08/10 03:23:11 UTC

[GitHub] incubator-carbondata pull request #70: [CARBONDATA-154] Fix the bug of block...

GitHub user Zhangshunyu opened a pull request:

    https://github.com/apache/incubator-carbondata/pull/70

    [CARBONDATA-154] Fix the bug of block prune that query result is wrong.

    ## Why raise this pr:
    
    During block prune, endkey is always only decided by the last filter expression, this is a bug
    and can lead wrong result,
    For example, when load data whose dimension column is 120000 lines of 'a', 120000 lines of 'b', 120000 lines of 'c', if query like "select * from tablename where colname='c' or colname='b' or colname='a'" only 120000lines 'a' will be selected because of wrong endkey.
    
    ## How to solve this:
    
    Fix the end key consider all the filter expression end key get max and start key get (min - 1) for each column level, using this to produce a new start key an a new endkey.
    
    For more details please look at the test case.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/Zhangshunyu/incubator-carbondata blockprune

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-carbondata/pull/70.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #70
    
----
commit d2bdb538f8b30df39ae3730aa0498a44ed934f03
Author: Zhangshunyu <zh...@huawei.com>
Date:   2016-08-10T03:09:20Z

    fix the bug og block prune

----


---
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.
---

[GitHub] incubator-carbondata pull request #70: [CARBONDATA-154] Fix the bug of block...

Posted by ravipesala <gi...@git.apache.org>.
Github user ravipesala commented on a diff in the pull request:

    https://github.com/apache/incubator-carbondata/pull/70#discussion_r74554497
  
    --- Diff: core/src/main/java/org/carbondata/scan/filter/FilterUtil.java ---
    @@ -669,27 +669,14 @@ public static DimColumnFilterInfo getFilterListForAllMembersRS(Expression expres
        * @param segmentProperties
        * @return long[] start key
        */
    -  public static long[] getStartKey(DimColumnResolvedFilterInfo dimColResolvedFilterInfo,
    -      SegmentProperties segmentProperties, long[] startKey) {
    -    Map<CarbonDimension, List<DimColumnFilterInfo>> dimensionFilter =
    -        dimColResolvedFilterInfo.getDimensionResolvedFilterInstance();
    -    for (Map.Entry<CarbonDimension, List<DimColumnFilterInfo>> entry : dimensionFilter.entrySet()) {
    -      List<DimColumnFilterInfo> values = entry.getValue();
    -      if (null == values || !entry.getKey().hasEncoding(Encoding.DICTIONARY)) {
    -        continue;
    -      }
    -      boolean isExcludePresent = false;
    -      for (DimColumnFilterInfo info : values) {
    -        if (!info.isIncludeFilter()) {
    -          isExcludePresent = true;
    -        }
    -      }
    -      if (isExcludePresent) {
    -        continue;
    -      }
    -      getStartKeyBasedOnFilterResoverInfo(dimensionFilter, startKey);
    +  public static void getStartKey(Map<CarbonDimension, List<DimColumnFilterInfo>> dimensionFilter,
    +      AbsoluteTableIdentifier tableIdentifier, long[] startKey, SegmentProperties segmentProperties,
    --- End diff --
    
    no use of `tableIdentifier` and `segmentProperties`, please remove from static method.


---
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.
---

[GitHub] incubator-carbondata pull request #70: [CARBONDATA-154] Fix the bug of block...

Posted by ravipesala <gi...@git.apache.org>.
Github user ravipesala commented on a diff in the pull request:

    https://github.com/apache/incubator-carbondata/pull/70#discussion_r74554574
  
    --- Diff: core/src/main/java/org/carbondata/scan/filter/FilterUtil.java ---
    @@ -711,7 +698,7 @@ public static DimColumnFilterInfo getFilterListForAllMembersRS(Expression expres
        */
       public static void getStartKeyForNoDictionaryDimension(
           DimColumnResolvedFilterInfo dimColResolvedFilterInfo, SegmentProperties segmentProperties,
    -      SortedMap<Integer, byte[]> setOfStartKeyByteArray) {
    +      SortedMap<Integer, byte[]> setOfStartKeyByteArray, List<long[]> startKeyList) {
    --- End diff --
    
    No use of `segmentProperties` and `startKeyList`, please remove it.


---
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.
---

[GitHub] incubator-carbondata pull request #70: [CARBONDATA-154] Fix the bug of block...

Posted by ravipesala <gi...@git.apache.org>.
Github user ravipesala commented on a diff in the pull request:

    https://github.com/apache/incubator-carbondata/pull/70#discussion_r74554655
  
    --- Diff: core/src/main/java/org/carbondata/scan/filter/FilterUtil.java ---
    @@ -766,7 +753,7 @@ public static void getStartKeyForNoDictionaryDimension(
        */
       public static void getEndKeyForNoDictionaryDimension(
           DimColumnResolvedFilterInfo dimColResolvedFilterInfo, SegmentProperties segmentProperties,
    -      SortedMap<Integer, byte[]> setOfEndKeyByteArray) {
    +      SortedMap<Integer, byte[]> setOfEndKeyByteArray, List<long[]> endKeyList) {
    --- End diff --
    
    Please remove `segmentProperties` and `endKeyList`


---
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.
---

[GitHub] incubator-carbondata pull request #70: [CARBONDATA-154] Fix the bug of block...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

    https://github.com/apache/incubator-carbondata/pull/70


---
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.
---