You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@carbondata.apache.org by mayunSaicmotor <gi...@git.apache.org> on 2017/03/12 02:55:45 UTC

[GitHub] incubator-carbondata pull request #649: [CARBONDATA-748] put 'if' clause out...

GitHub user mayunSaicmotor opened a pull request:

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

    [CARBONDATA-748] put 'if' clause out of the 'for' clause and add test case

    put the 'if' clause out of the  'for' clause to avoid to execute too many 'if' clause and improve performance

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

    $ git pull https://github.com/mayunSaicmotor/incubator-carbondata FIX-CARBONDATA-748

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

    https://github.com/apache/incubator-carbondata/pull/649.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 #649
    
----
commit 4124208106620fe762c340a036e78cc9f4b2955c
Author: mayun <si...@163.com>
Date:   2017-03-12T02:51:36Z

    put if clause out of the for clause and add test case

----


---
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 issue #649: [CARBONDATA-748] put 'if' clause out of the...

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/incubator-carbondata/pull/649
  
    Build Success with Spark 1.6.2, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder/1097/



---
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 issue #649: [CARBONDATA-748] put 'if' clause out of the...

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/incubator-carbondata/pull/649
  
    Build Success with Spark 1.6.2, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder/1096/



---
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 #649: [CARBONDATA-748] put 'if' clause out...

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

    https://github.com/apache/incubator-carbondata/pull/649#discussion_r105549626
  
    --- Diff: core/src/test/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecuterImplTest.java ---
    @@ -96,13 +93,39 @@ private BitSet setFilterdIndexToBitSet(DimensionColumnDataChunk dimensionColumnD
       @Test
       public void testPerformance() {
     
    -    long oldTime = 0;
    -    long newTime = 0;
    -    long start;
         int dataCnt = 120000;
    +    int queryCnt = 5;
    +    int repeatCnt = 200;
    +    
         int filterCnt = 800;
    +    comparePerformance(dataCnt, filterCnt, queryCnt, repeatCnt);
    +    
    +    filterCnt = 100;
    +    comparePerformance(dataCnt, filterCnt, queryCnt, repeatCnt);
    +
    +  }
    +  
    +  @Test
    +  public void testBoundary() {
    --- End diff --
    
    Can you explain why add testBoundary() ?


---
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 issue #649: [CARBONDATA-748] put 'if' clause out of the...

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/incubator-carbondata/pull/649
  
    Build Success with Spark 1.6.2, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder/1098/



---
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 issue #649: [CARBONDATA-748] put 'if' clause out of the...

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/incubator-carbondata/pull/649
  
    Build Success with Spark 1.6.2, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder/1093/



---
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 #649: [CARBONDATA-748] put 'if' clause out...

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

    https://github.com/apache/incubator-carbondata/pull/649#discussion_r105548338
  
    --- Diff: core/src/main/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecuterImpl.java ---
    @@ -138,23 +138,23 @@ private BitSet setFilterdIndexToBitSet(DimensionColumnDataChunk dimensionColumnD
         BitSet bitSet = new BitSet(numerOfRows);
         if (dimensionColumnDataChunk instanceof FixedLengthDimensionDataChunk) {
           byte[][] filterValues = dimColumnExecuterInfo.getFilterKeys();
    -      for (int i = 0; i < numerOfRows; i++) {
    +      if (filterValues.length > 1) {
     
    -        if (filterValues.length > 1) {
    +        for (int i = 0; i < numerOfRows; i++) {
               int index = CarbonUtil.binarySearch(filterValues, 0, filterValues.length - 1,
                   dimensionColumnDataChunk.getChunkData(i));
     
               if (index >= 0) {
                 bitSet.set(i);
               }
    -        } else if (filterValues.length == 1) {
    +        }
    +      } else if (filterValues.length == 1) {
    +
    --- End diff --
    
    Please remove the blank row


---
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 #649: [CARBONDATA-748] put 'if' clause out...

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

    https://github.com/apache/incubator-carbondata/pull/649#discussion_r105548334
  
    --- Diff: core/src/test/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecuterImplTest.java ---
    @@ -41,21 +41,20 @@ private BitSet setFilterdIndexToBitSetNew(DimensionColumnDataChunk dimensionColu
         BitSet bitSet = new BitSet(numerOfRows);
         if (dimensionColumnDataChunk instanceof FixedLengthDimensionDataChunk) {
           // byte[][] filterValues = dimColumnExecuterInfo.getFilterKeys();
    -      for (int i = 0; i < numerOfRows; i++) {
    -
    -        if (filterValues.length > 1) {
    +      if (filterValues.length > 1) {
    +        for (int i = 0; i < numerOfRows; i++) {
               int index = CarbonUtil.binarySearch(filterValues, 0, filterValues.length - 1,
    --- End diff --
    
    Please remove the blank row


---
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 #649: [CARBONDATA-748] put 'if' clause out...

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

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


---
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 issue #649: [CARBONDATA-748] put 'if' clause out of the...

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/incubator-carbondata/pull/649
  
    Build Success with Spark 1.6.2, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder/1092/



---
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 #649: [CARBONDATA-748] put 'if' clause out...

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

    https://github.com/apache/incubator-carbondata/pull/649#discussion_r105548693
  
    --- Diff: core/src/test/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecuterImplTest.java ---
    @@ -41,21 +41,20 @@ private BitSet setFilterdIndexToBitSetNew(DimensionColumnDataChunk dimensionColu
         BitSet bitSet = new BitSet(numerOfRows);
         if (dimensionColumnDataChunk instanceof FixedLengthDimensionDataChunk) {
           // byte[][] filterValues = dimColumnExecuterInfo.getFilterKeys();
    -      for (int i = 0; i < numerOfRows; i++) {
    -
    -        if (filterValues.length > 1) {
    +      if (filterValues.length > 1) {
    +        for (int i = 0; i < numerOfRows; i++) {
               int index = CarbonUtil.binarySearch(filterValues, 0, filterValues.length - 1,
    --- End diff --
    
    removed


---
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 #649: [CARBONDATA-748] put 'if' clause out...

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

    https://github.com/apache/incubator-carbondata/pull/649#discussion_r105550419
  
    --- Diff: core/src/test/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecuterImplTest.java ---
    @@ -96,13 +93,39 @@ private BitSet setFilterdIndexToBitSet(DimensionColumnDataChunk dimensionColumnD
       @Test
       public void testPerformance() {
     
    -    long oldTime = 0;
    -    long newTime = 0;
    -    long start;
         int dataCnt = 120000;
    +    int queryCnt = 5;
    +    int repeatCnt = 200;
    +    
         int filterCnt = 800;
    +    comparePerformance(dataCnt, filterCnt, queryCnt, repeatCnt);
    +    
    +    filterCnt = 100;
    +    comparePerformance(dataCnt, filterCnt, queryCnt, repeatCnt);
    +
    +  }
    +  
    +  @Test
    +  public void testBoundary() {
    --- End diff --
    
    added test comment


---
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 issue #649: [CARBONDATA-748] put 'if' clause out of the...

Posted by chenliang613 <gi...@git.apache.org>.
Github user chenliang613 commented on the issue:

    https://github.com/apache/incubator-carbondata/pull/649
  
    LGTM


---
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 issue #649: [CARBONDATA-748] put 'if' clause out of the...

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/incubator-carbondata/pull/649
  
    Build Success with Spark 1.6.2, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder/1099/



---
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 #649: [CARBONDATA-748] put 'if' clause out...

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

    https://github.com/apache/incubator-carbondata/pull/649#discussion_r105548337
  
    --- Diff: core/src/main/java/org/apache/carbondata/core/scan/filter/executer/IncludeFilterExecuterImpl.java ---
    @@ -138,23 +138,23 @@ private BitSet setFilterdIndexToBitSet(DimensionColumnDataChunk dimensionColumnD
         BitSet bitSet = new BitSet(numerOfRows);
         if (dimensionColumnDataChunk instanceof FixedLengthDimensionDataChunk) {
           byte[][] filterValues = dimColumnExecuterInfo.getFilterKeys();
    -      for (int i = 0; i < numerOfRows; i++) {
    +      if (filterValues.length > 1) {
     
    --- End diff --
    
    Please remove the blank row


---
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 issue #649: [CARBONDATA-748] put 'if' clause out of the...

Posted by CarbonDataQA <gi...@git.apache.org>.
Github user CarbonDataQA commented on the issue:

    https://github.com/apache/incubator-carbondata/pull/649
  
    Build Success with Spark 1.6.2, Please check CI http://136.243.101.176:8080/job/ApacheCarbonPRBuilder/1094/



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