You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2020/03/10 00:12:28 UTC

[GitHub] [druid] jon-wei opened a new pull request #9490: Fix NPE when using IndexedTable and all left rows are filtered out

jon-wei opened a new pull request #9490: Fix NPE when using IndexedTable and all left rows are filtered out
URL: https://github.com/apache/druid/pull/9490
 
 
   This PR fixes an NPE that can occur with joins on RHS tables backed by IndexedTable, where if `IndexedTableJoinMatcher` never gets `reset`, `matchRemainder`, or `matchCondition` called (this can occur when all left rows have been filtered out), the `IndexedTableJoinMatcher` will incorrectly return true for `hasMatch` because the `currentRow` variable was never initialized.
   
   This PR initializes `currentRow` in the constructor.
   
   This PR has:
   - [x] been self-reviewed.
   - [ ] added documentation for new or modified features or behaviors.
   - [ ] added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.
   - [ ] added or updated version, license, or notice information in [licenses.yaml](https://github.com/apache/druid/blob/master/licenses.yaml)
   - [ ] added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
   - [x] added unit tests or modified existing tests to cover new code paths.
   - [ ] added integration tests.
   - [x] been tested in a test Druid cluster.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] jon-wei commented on a change in pull request #9490: Fix NPE when using IndexedTable and all left rows are filtered out

Posted by GitBox <gi...@apache.org>.
jon-wei commented on a change in pull request #9490: Fix NPE when using IndexedTable and all left rows are filtered out
URL: https://github.com/apache/druid/pull/9490#discussion_r391330991
 
 

 ##########
 File path: processing/src/main/java/org/apache/druid/segment/join/table/IndexedTableJoinMatcher.java
 ##########
 @@ -81,6 +81,7 @@
   )
   {
     this.table = table;
+    this.currentRow = -1;
 
 Review comment:
   Added a constant

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] jon-wei merged pull request #9490: Fix NPE when using IndexedTable and all left rows are filtered out

Posted by GitBox <gi...@apache.org>.
jon-wei merged pull request #9490: Fix NPE when using IndexedTable and all left rows are filtered out
URL: https://github.com/apache/druid/pull/9490
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] codecov-io commented on issue #9490: Fix NPE when using IndexedTable and all left rows are filtered out

Posted by GitBox <gi...@apache.org>.
codecov-io commented on issue #9490: Fix NPE when using IndexedTable and all left rows are filtered out
URL: https://github.com/apache/druid/pull/9490#issuecomment-597973503
 
 
   # [Codecov](https://codecov.io/gh/apache/druid/pull/9490?src=pr&el=h1) Report
   > Merging [#9490](https://codecov.io/gh/apache/druid/pull/9490?src=pr&el=desc) into [master](https://codecov.io/gh/apache/druid/commit/7401bb3f9315bf0622b6e0fe7c7fd855d1c65052?src=pr&el=desc) will **increase** coverage by `0.97%`.
   > The diff coverage is `100%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/druid/pull/9490/graphs/tree.svg?width=650&token=hn9gC9NXg0&height=150&src=pr)](https://codecov.io/gh/apache/druid/pull/9490?src=pr&el=tree)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #9490      +/-   ##
   ============================================
   + Coverage     63.56%   64.53%   +0.97%     
   - Complexity    23489    23561      +72     
   ============================================
     Files          3040     2932     -108     
     Lines        125895   119863    -6032     
     Branches      17410    16046    -1364     
   ============================================
   - Hits          80026    77359    -2667     
   + Misses        38673    35522    -3151     
   + Partials       7196     6982     -214
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/druid/pull/9490?src=pr&el=tree) | Coverage Δ | Complexity Δ | |
   |---|---|---|---|
   | [...id/segment/join/table/IndexedTableJoinMatcher.java](https://codecov.io/gh/apache/druid/pull/9490/diff?src=pr&el=tree#diff-cHJvY2Vzc2luZy9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZHJ1aWQvc2VnbWVudC9qb2luL3RhYmxlL0luZGV4ZWRUYWJsZUpvaW5NYXRjaGVyLmphdmE=) | `87.23% <100%> (+0.09%)` | `27 <0> (ø)` | :arrow_down: |
   | [...main/java/org/apache/druid/guice/DruidBinders.java](https://codecov.io/gh/apache/druid/pull/9490/diff?src=pr&el=tree#diff-c2VydmVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kcnVpZC9ndWljZS9EcnVpZEJpbmRlcnMuamF2YQ==) | `33.33% <0%> (-8.34%)` | `3% <0%> (ø)` | |
   | [...org/apache/druid/segment/realtime/FireHydrant.java](https://codecov.io/gh/apache/druid/pull/9490/diff?src=pr&el=tree#diff-c2VydmVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kcnVpZC9zZWdtZW50L3JlYWx0aW1lL0ZpcmVIeWRyYW50LmphdmE=) | `58.33% <0%> (-8.34%)` | `14% <0%> (-1%)` | |
   | [...g/apache/druid/query/FluentQueryRunnerBuilder.java](https://codecov.io/gh/apache/druid/pull/9490/diff?src=pr&el=tree#diff-cHJvY2Vzc2luZy9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZHJ1aWQvcXVlcnkvRmx1ZW50UXVlcnlSdW5uZXJCdWlsZGVyLmphdmE=) | `75% <0%> (-5%)` | `2% <0%> (ø)` | |
   | [.../server/lookup/namespace/cache/CacheScheduler.java](https://codecov.io/gh/apache/druid/pull/9490/diff?src=pr&el=tree#diff-ZXh0ZW5zaW9ucy1jb3JlL2xvb2t1cHMtY2FjaGVkLWdsb2JhbC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZHJ1aWQvc2VydmVyL2xvb2t1cC9uYW1lc3BhY2UvY2FjaGUvQ2FjaGVTY2hlZHVsZXIuamF2YQ==) | `75.56% <0%> (-2.85%)` | `9% <0%> (ø)` | |
   | [.../java/org/apache/druid/query/InlineDataSource.java](https://codecov.io/gh/apache/druid/pull/9490/diff?src=pr&el=tree#diff-cHJvY2Vzc2luZy9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZHJ1aWQvcXVlcnkvSW5saW5lRGF0YVNvdXJjZS5qYXZh) | `85.1% <0%> (-1.57%)` | `27% <0%> (ø)` | |
   | [...query/groupby/epinephelinae/ConcurrentGrouper.java](https://codecov.io/gh/apache/druid/pull/9490/diff?src=pr&el=tree#diff-cHJvY2Vzc2luZy9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZHJ1aWQvcXVlcnkvZ3JvdXBieS9lcGluZXBoZWxpbmFlL0NvbmN1cnJlbnRHcm91cGVyLmphdmE=) | `70.8% <0%> (-0.73%)` | `28% <0%> (-1%)` | |
   | [...rdinatorBasicAuthorizerMetadataStorageUpdater.java](https://codecov.io/gh/apache/druid/pull/9490/diff?src=pr&el=tree#diff-ZXh0ZW5zaW9ucy1jb3JlL2RydWlkLWJhc2ljLXNlY3VyaXR5L3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kcnVpZC9zZWN1cml0eS9iYXNpYy9hdXRob3JpemF0aW9uL2RiL3VwZGF0ZXIvQ29vcmRpbmF0b3JCYXNpY0F1dGhvcml6ZXJNZXRhZGF0YVN0b3JhZ2VVcGRhdGVyLmphdmE=) | `63.32% <0%> (-0.41%)` | `76% <0%> (-1%)` | |
   | [...java/org/apache/druid/query/groupby/ResultRow.java](https://codecov.io/gh/apache/druid/pull/9490/diff?src=pr&el=tree#diff-cHJvY2Vzc2luZy9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvZHJ1aWQvcXVlcnkvZ3JvdXBieS9SZXN1bHRSb3cuamF2YQ==) | `87.23% <0%> (-0.27%)` | `19% <0%> (-1%)` | |
   | [.../apache/druid/server/ClientQuerySegmentWalker.java](https://codecov.io/gh/apache/druid/pull/9490/diff?src=pr&el=tree#diff-c2VydmVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9kcnVpZC9zZXJ2ZXIvQ2xpZW50UXVlcnlTZWdtZW50V2Fsa2VyLmphdmE=) | `0% <0%> (ø)` | `0% <0%> (ø)` | :arrow_down: |
   | ... and [139 more](https://codecov.io/gh/apache/druid/pull/9490/diff?src=pr&el=tree-more) | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/druid/pull/9490?src=pr&el=continue).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/druid/pull/9490?src=pr&el=footer). Last update [7401bb3...7780ce4](https://codecov.io/gh/apache/druid/pull/9490?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] ccaominh commented on a change in pull request #9490: Fix NPE when using IndexedTable and all left rows are filtered out

Posted by GitBox <gi...@apache.org>.
ccaominh commented on a change in pull request #9490: Fix NPE when using IndexedTable and all left rows are filtered out
URL: https://github.com/apache/druid/pull/9490#discussion_r390601557
 
 

 ##########
 File path: processing/src/main/java/org/apache/druid/segment/join/table/IndexedTableJoinMatcher.java
 ##########
 @@ -81,6 +81,7 @@
   )
   {
     this.table = table;
+    this.currentRow = -1;
 
 Review comment:
   Perhaps create a named constant for this that's also used by the `reset()` method in this class

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


[GitHub] [druid] ccaominh commented on a change in pull request #9490: Fix NPE when using IndexedTable and all left rows are filtered out

Posted by GitBox <gi...@apache.org>.
ccaominh commented on a change in pull request #9490: Fix NPE when using IndexedTable and all left rows are filtered out
URL: https://github.com/apache/druid/pull/9490#discussion_r391349609
 
 

 ##########
 File path: processing/src/main/java/org/apache/druid/segment/join/table/IndexedTableJoinMatcher.java
 ##########
 @@ -59,6 +59,8 @@
 
 public class IndexedTableJoinMatcher implements JoinMatcher
 {
+  private final static int UNINITIALIZED_CURRENT_ROW = -1;
 
 Review comment:
   Checkstyle is flagging this:
   ```
   ERROR] /home/travis/build/apache/druid/processing/src/main/java/org/apache/druid/segment/join/table/IndexedTableJoinMatcher.java:62:17: 'static' modifier out of order with the JLS suggestions. [ModifierOrder]
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org