Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KYLIN-2971 Fix the wrong "Realization Names" and missing "Cuboid Ids" in logQuery when hit cache #1215

Merged
merged 1 commit into from May 22, 2020

Conversation

zzcclp
Copy link

@zzcclp zzcclp commented May 20, 2020

Problems:

  1. The value of "Realization Names" in logQuery is wrong when query two different sqls within the same thread and second sql hits cache:
    Example:
    1). query Q1 hit project P1 and cube C1;
    2). query Q2 hit project P2 and cube C2 in the same thread with Q1;
    3). Q1 comes again and hits cache, it will show project P1 and cube C2. However, it should be cube C1.

  2. Missing "Cuboid Ids" in logQuery when hit cache in a new thread which does not have OLAPContext;

Solutions:

  1. Call 'OLAPContext.clearThreadLocalContexts()' before a query starts;
  2. Get "Cuboid Ids" from SQLResponse when "OLAPContext.getThreadLocalContexts()" is null;

Proposed changes

Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request. If it fixes a bug or resolves a feature request, be sure to link to that issue.

Types of changes

What types of changes does your code introduce to Kylin?
Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices apply)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I have create an issue on Kylin's jira, and have described the bug/feature there in detail
  • Commit messages in my PR start with the related jira ID, like "KYLIN-0000 Make Kylin project open-source"
  • Compiling and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • If this change need a document change, I will prepare another pr against the document branch
  • Any dependent changes have been merged

Further comments

If this is a relatively large or complex change, kick off the discussion at user@kylin or dev@kylin by explaining why you chose the solution you did and what alternatives you considered, etc...

@coveralls
Copy link

coveralls commented May 20, 2020

Pull Request Test Coverage Report for Build 5929

  • 0 of 13 (0.0%) changed or added relevant lines in 1 file are covered.
  • 5 unchanged lines in 3 files lost coverage.
  • Overall coverage decreased (-0.009%) to 27.285%

Changes Missing Coverage Covered Lines Changed/Added Lines %
server-base/src/main/java/org/apache/kylin/rest/service/QueryService.java 0 13 0.0%
Files with Coverage Reduction New Missed Lines %
core-dictionary/src/main/java/org/apache/kylin/dict/lookup/cache/RocksDBLookupTable.java 1 81.08%
core-cube/src/main/java/org/apache/kylin/cube/cuboid/TreeCuboidScheduler.java 2 68.46%
stream-core/src/main/java/org/apache/kylin/stream/core/storage/CheckPointStore.java 2 73.74%
Totals Coverage Status
Change from base Build 5911: -0.009%
Covered Lines: 24348
Relevant Lines: 89237

💛 - Coveralls

@codecov-commenter
Copy link

codecov-commenter commented May 20, 2020

Codecov Report

Merging #1215 into master will decrease coverage by 0.02%.
The diff coverage is 0.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1215      +/-   ##
============================================
- Coverage     24.85%   24.83%   -0.03%     
+ Complexity     6266     6263       -3     
============================================
  Files          1453     1453              
  Lines         89225    89237      +12     
  Branches      12456    12458       +2     
============================================
- Hits          22181    22165      -16     
- Misses        64869    64892      +23     
- Partials       2175     2180       +5     
Impacted Files Coverage Δ Complexity Δ
...va/org/apache/kylin/rest/service/QueryService.java 0.00% <0.00%> (ø) 0.00 <0.00> (ø)
...he/kylin/dict/lookup/cache/RocksDBLookupTable.java 72.97% <0.00%> (-5.41%) 6.00% <0.00%> (-1.00%)
...org/apache/kylin/rest/util/QueryRequestLimits.java 35.71% <0.00%> (-4.77%) 5.00% <0.00%> (-1.00%)
...che/kylin/stream/core/storage/CheckPointStore.java 63.63% <0.00%> (-3.04%) 21.00% <0.00%> (-1.00%)
.../apache/kylin/cube/cuboid/TreeCuboidScheduler.java 63.84% <0.00%> (-2.31%) 0.00% <0.00%> (ø%)
...rg/apache/kylin/cube/inmemcubing/MemDiskStore.java 69.30% <0.00%> (-1.83%) 7.00% <0.00%> (ø%)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7886a24...2ef96ec. Read the comment docs.

… in logQuery when hit cache

Problems:
1. The value of "Realization Names" in logQuery is wrong when query two different sqls within the same thread and second sql hits cache:
Example:
 1). query Q1 hit project P1 and cube C1;
 2). query Q2 hit project P2 and cube C2 in the same thread with Q1;
 3). Q1 comes again and hits cache, it will show project P1 and cube C2. However, it should be cube C1.

2. Missing "Cuboid Ids" in logQuery when hit cache in a new thread which does not have OLAPContext;

Solutions:
1. Call 'OLAPContext.clearThreadLocalContexts()' before a query starts;
2. Get "Cuboid Ids" from SQLResponse when "OLAPContext.getThreadLocalContexts()" is null;
Copy link
Contributor

@shaofengshi shaofengshi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 LGTM

@shaofengshi shaofengshi merged commit b8d55d0 into apache:master May 22, 2020
@kyotoYaho
Copy link
Contributor

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants