[GitHub] carbondata pull request #2820: [CARBONDATA-3013] Added support for pruning p...

classic Classic list List threaded Threaded
63 messages Options
1234
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #2820: [CARBONDATA-3013] Added support for pruning pages fo...

qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/2820
 
    Build Success with Spark 2.2.1, Please check CI http://95.216.28.178:8080/job/ApacheCarbonPRBuilder1/1127/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #2820: [CARBONDATA-3013] Added support for pruning p...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user ravipesala commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/2820#discussion_r227321029
 
    --- Diff: core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RestructureEvaluatorImpl.java ---
    @@ -104,6 +108,12 @@ protected boolean isDimensionDefaultValuePresentInFilterValues(
         return isDefaultValuePresentInFilterValues;
       }
     
    +  @Override
    +  public BitSet prunePages(RawBlockletColumnChunks rawBlockletColumnChunks)
    +      throws FilterUnsupportedException, IOException {
    +    return new BitSet();
    --- End diff --
   
    ok


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #2820: [CARBONDATA-3013] Added support for pruning p...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user ravipesala commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/2820#discussion_r227321547
 
    --- Diff: core/src/main/java/org/apache/carbondata/core/scan/filter/executer/RowLevelRangeGrtrThanEquaToFilterExecuterImpl.java ---
    @@ -331,6 +319,80 @@ public BitSetGroup applyFilter(RawBlockletColumnChunks rawBlockletColumnChunks,
         }
       }
     
    +  private boolean isScanRequired(DimensionRawColumnChunk rawColumnChunk, int i) {
    --- End diff --
   
    ok


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #2820: [CARBONDATA-3013] Added support for pruning p...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user ravipesala commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/2820#discussion_r227321710
 
    --- Diff: core/src/main/java/org/apache/carbondata/core/scan/scanner/impl/BlockletFilterScanner.java ---
    @@ -98,7 +98,11 @@ public BlockletFilterScanner(BlockExecutionInfo blockExecutionInfo,
       @Override
       public BlockletScannedResult scanBlocklet(RawBlockletColumnChunks rawBlockletColumnChunks)
           throws IOException, FilterUnsupportedException {
    -    return executeFilter(rawBlockletColumnChunks);
    +    if (blockExecutionInfo.isDirectVectorFill()) {
    +      return executeFilterForPages(rawBlockletColumnChunks);
    +    } else {
    +      return executeFilter(rawBlockletColumnChunks);
    --- End diff --
   
    ok, this would be big refactoring, we can consider in future PR


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #2820: [CARBONDATA-3013] Added support for pruning p...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user ravipesala commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/2820#discussion_r227321970
 
    --- Diff: core/src/main/java/org/apache/carbondata/core/scan/scanner/impl/BlockletFilterScanner.java ---
    @@ -316,4 +320,164 @@ private BlockletScannedResult executeFilter(RawBlockletColumnChunks rawBlockletC
             readTime.getCount() + dimensionReadTime);
         return scannedResult;
       }
    +
    +  /**
    +   * This method will process the data in below order
    +   * 1. first apply min max on the filter tree and check whether any of the filter
    +   * is fall on the range of min max, if not then return empty result
    +   * 2. If filter falls on min max range then apply filter on actual
    +   * data and get the pruned pages.
    +   * 3. if pruned pages are not empty then read only those blocks(measure or dimension)
    +   * which was present in the query but not present in the filter, as while applying filter
    +   * some of the blocks where already read and present in chunk holder so not need to
    +   * read those blocks again, this is to avoid reading of same blocks which was already read
    +   * 4. Set the blocks and filter pages to scanned result
    +   *
    +   * @param rawBlockletColumnChunks blocklet raw chunk of all columns
    +   * @throws FilterUnsupportedException
    +   */
    +  private BlockletScannedResult executeFilterForPages(
    +      RawBlockletColumnChunks rawBlockletColumnChunks)
    +      throws FilterUnsupportedException, IOException {
    +    long startTime = System.currentTimeMillis();
    +    QueryStatistic totalBlockletStatistic = queryStatisticsModel.getStatisticsTypeAndObjMap()
    +        .get(QueryStatisticsConstants.TOTAL_BLOCKLET_NUM);
    +    totalBlockletStatistic.addCountStatistic(QueryStatisticsConstants.TOTAL_BLOCKLET_NUM,
    +        totalBlockletStatistic.getCount() + 1);
    +    // apply filter on actual data, for each page
    +    BitSet pages = this.filterExecuter.prunePages(rawBlockletColumnChunks);
    +    // if filter result is empty then return with empty result
    +    if (pages.isEmpty()) {
    +      CarbonUtil.freeMemory(rawBlockletColumnChunks.getDimensionRawColumnChunks(),
    +          rawBlockletColumnChunks.getMeasureRawColumnChunks());
    +
    +      QueryStatistic scanTime = queryStatisticsModel.getStatisticsTypeAndObjMap()
    +          .get(QueryStatisticsConstants.SCAN_BLOCKlET_TIME);
    +      scanTime.addCountStatistic(QueryStatisticsConstants.SCAN_BLOCKlET_TIME,
    +          scanTime.getCount() + (System.currentTimeMillis() - startTime));
    +
    +      QueryStatistic scannedPages = queryStatisticsModel.getStatisticsTypeAndObjMap()
    +          .get(QueryStatisticsConstants.PAGE_SCANNED);
    +      scannedPages.addCountStatistic(QueryStatisticsConstants.PAGE_SCANNED,
    +          scannedPages.getCount());
    +      return createEmptyResult();
    +    }
    +
    +    BlockletScannedResult scannedResult =
    +        new FilterQueryScannedResult(blockExecutionInfo, queryStatisticsModel);
    +
    +    // valid scanned blocklet
    +    QueryStatistic validScannedBlockletStatistic = queryStatisticsModel.getStatisticsTypeAndObjMap()
    +        .get(QueryStatisticsConstants.VALID_SCAN_BLOCKLET_NUM);
    +    validScannedBlockletStatistic
    +        .addCountStatistic(QueryStatisticsConstants.VALID_SCAN_BLOCKLET_NUM,
    +            validScannedBlockletStatistic.getCount() + 1);
    +    // adding statistics for valid number of pages
    +    QueryStatistic validPages = queryStatisticsModel.getStatisticsTypeAndObjMap()
    +        .get(QueryStatisticsConstants.VALID_PAGE_SCANNED);
    +    validPages.addCountStatistic(QueryStatisticsConstants.VALID_PAGE_SCANNED,
    +        validPages.getCount() + pages.cardinality());
    +    QueryStatistic scannedPages = queryStatisticsModel.getStatisticsTypeAndObjMap()
    +        .get(QueryStatisticsConstants.PAGE_SCANNED);
    +    scannedPages.addCountStatistic(QueryStatisticsConstants.PAGE_SCANNED,
    +        scannedPages.getCount() + pages.cardinality());
    +    // get the row indexes from bit set for each page
    +    int[] pageFilteredPages = new int[pages.cardinality()];
    +    int index = 0;
    +    for (int i = pages.nextSetBit(0); i >= 0; i = pages.nextSetBit(i + 1)) {
    +      pageFilteredPages[index++] = i;
    +    }
    +    // count(*)  case there would not be any dimensions are measures selected.
    +    int[] numberOfRows = new int[pages.cardinality()];
    +    for (int i = 0; i < numberOfRows.length; i++) {
    +      numberOfRows[i] = rawBlockletColumnChunks.getDataBlock().getPageRowCount(i);
    +    }
    +    long dimensionReadTime = System.currentTimeMillis();
    +    dimensionReadTime = System.currentTimeMillis() - dimensionReadTime;
    --- End diff --
   
    ok


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #2820: [CARBONDATA-3013] Added support for pruning p...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user ravipesala commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/2820#discussion_r228091134
 
    --- Diff: core/src/main/java/org/apache/carbondata/core/datastore/chunk/impl/DimensionRawColumnChunk.java ---
    @@ -121,6 +122,22 @@ public DimensionColumnPage convertToDimColDataChunkWithOutCache(int index) {
         }
       }
     
    +  /**
    +   * Convert raw data with specified page number processed to DimensionColumnDataChunk and fill
    +   * the vector
    +   *
    +   * @param pageNumber page number to decode and fill the vector
    +   * @param vectorInfo vector to be filled with column page
    +   */
    +  public void convertToDimColDataChunkAndFillVector(int pageNumber, ColumnVectorInfo vectorInfo) {
    +    assert pageNumber < pagesCount;
    +    try {
    +      chunkReader.decodeColumnPageAndFillVector(this, pageNumber, vectorInfo);
    +    } catch (Exception e) {
    +      throw new RuntimeException(e);
    --- End diff --
   
    Because it is checked exception, that is why wrapped with unchecked exception


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #2820: [CARBONDATA-3013] Added support for pruning p...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user ravipesala commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/2820#discussion_r228092934
 
    --- Diff: core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ExcludeFilterExecuterImpl.java ---
    @@ -143,6 +144,40 @@ public BitSetGroup applyFilter(RawBlockletColumnChunks rawBlockletColumnChunks,
         return null;
       }
     
    +  @Override
    +  public BitSet prunePages(RawBlockletColumnChunks rawBlockletColumnChunks)
    +      throws FilterUnsupportedException, IOException {
    +    if (isDimensionPresentInCurrentBlock) {
    +      int chunkIndex = segmentProperties.getDimensionOrdinalToChunkMapping()
    +          .get(dimColEvaluatorInfo.getColumnIndex());
    +      if (null == rawBlockletColumnChunks.getDimensionRawColumnChunks()[chunkIndex]) {
    --- End diff --
   
    ok


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #2820: [CARBONDATA-3013] Added support for pruning pages fo...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/2820
 
    Build Failed with Spark 2.2.1, Please check CI http://95.216.28.178:8080/job/ApacheCarbonPRBuilder1/1227/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #2820: [CARBONDATA-3013] Added support for pruning pages fo...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/2820
 
    Build Failed  with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder2.1/1014/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #2820: [CARBONDATA-3013] Added support for pruning pages fo...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/2820
 
    Build Failed  with Spark 2.3.1, Please check CI http://136.243.101.176:8080/job/carbondataprbuilder2.3/9279/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #2820: [CARBONDATA-3013] Added support for pruning pages fo...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/2820
 
    Build Failed with Spark 2.2.1, Please check CI http://95.216.28.178:8080/job/ApacheCarbonPRBuilder1/1244/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #2820: [CARBONDATA-3013] Added support for pruning pages fo...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/2820
 
    Build Failed  with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder2.1/1032/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #2820: [CARBONDATA-3013] Added support for pruning pages fo...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/2820
 
    Build Failed  with Spark 2.3.1, Please check CI http://136.243.101.176:8080/job/carbondataprbuilder2.3/9297/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #2820: [CARBONDATA-3013] Added support for pruning pages fo...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/2820
 
    Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder2.1/1034/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #2820: [CARBONDATA-3013] Added support for pruning pages fo...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/2820
 
    Build Success with Spark 2.3.1, Please check CI http://136.243.101.176:8080/job/carbondataprbuilder2.3/9299/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #2820: [CARBONDATA-3013] Added support for pruning pages fo...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/2820
 
    Build Success with Spark 2.2.1, Please check CI http://95.216.28.178:8080/job/ApacheCarbonPRBuilder1/1246/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #2820: [CARBONDATA-3013] Added support for pruning p...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user jackylk commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/2820#discussion_r228457926
 
    --- Diff: core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ImplicitIncludeFilterExecutorImpl.java ---
    @@ -53,6 +53,14 @@ public BitSetGroup applyFilter(RawBlockletColumnChunks rawBlockletColumnChunks,
         return bitSetGroup;
       }
     
    +  @Override
    +  public BitSet prunePages(RawBlockletColumnChunks rawBlockletColumnChunks)
    +      throws FilterUnsupportedException, IOException {
    +    BitSet bitSet = new BitSet(rawBlockletColumnChunks.getDataBlock().numberOfPages());
    +    bitSet.set(0, rawBlockletColumnChunks.getDataBlock().numberOfPages());
    --- End diff --
   
    add a local variable for `rawBlockletColumnChunks.getDataBlock().numberOfPages()`


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata pull request #2820: [CARBONDATA-3013] Added support for pruning p...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user ravipesala commented on a diff in the pull request:

    https://github.com/apache/carbondata/pull/2820#discussion_r228468538
 
    --- Diff: core/src/main/java/org/apache/carbondata/core/scan/filter/executer/ImplicitIncludeFilterExecutorImpl.java ---
    @@ -53,6 +53,14 @@ public BitSetGroup applyFilter(RawBlockletColumnChunks rawBlockletColumnChunks,
         return bitSetGroup;
       }
     
    +  @Override
    +  public BitSet prunePages(RawBlockletColumnChunks rawBlockletColumnChunks)
    +      throws FilterUnsupportedException, IOException {
    +    BitSet bitSet = new BitSet(rawBlockletColumnChunks.getDataBlock().numberOfPages());
    +    bitSet.set(0, rawBlockletColumnChunks.getDataBlock().numberOfPages());
    --- End diff --
   
    ok


---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #2820: [CARBONDATA-3013] Added support for pruning pages fo...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/carbondata/pull/2820
 
    Build Success with Spark 2.1.0, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder2.1/1040/



---
Reply | Threaded
Open this post in threaded view
|

[GitHub] carbondata issue #2820: [CARBONDATA-3013] Added support for pruning pages fo...

qiuchenjian-2
In reply to this post by qiuchenjian-2
Github user kumarvishal09 commented on the issue:

    https://github.com/apache/carbondata/pull/2820
 
    LGTM


---
1234