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
Support timely invalidation of parquet metadata cache #17500
Conversation
a0519e1
to
0bcc616
Compare
Hi @shixuan-fan and @highker , can you please help review when you have time? I'm sorry to include the other two commits from the latest master branch that are not mine, because some test cases failed incorrectly which can pass on my mac. When i pull the latest master branch into my local branch, the tests are all passed, a little strange ha ha. |
thank you, @hackeryang |
Thank you for your review, @zhenxiao . Sorry the 3 commits confused you, yes the real commit is f429df5. The other two commits is not mine, they are in the latest master branch. I just need the contents in the latest master branch to pass the tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @hackeryang ! Looks like some irrelevant commits are involved in this PR, could you help to clean up first? Thanks!
presto-parquet/src/main/java/com/facebook/presto/parquet/cache/MetadataReader.java
Outdated
Show resolved
Hide resolved
...to-parquet/src/main/java/com/facebook/presto/parquet/cache/CachingParquetMetadataSource.java
Outdated
Show resolved
Hide resolved
presto-hive/src/main/java/com/facebook/presto/hive/parquet/ParquetPageSourceFactory.java
Outdated
Show resolved
Hide resolved
if the other two commits have been merged to master, could you try rebase master and push again? thx! |
OK, i will try to rebase and clean the commits, thank you~ |
281b20e
to
d872c4b
Compare
Hi, @zhenxiao and @beinan , all of your advices above have been in the codes, please help review again when you have time~Thank you |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @hackeryang , the PR looks good to me, do you mind to add a unit test to cover this feature? thanks a lot!
ParquetFileMetadata fileMetadataCache = cache.get( | ||
parquetDataSource.getId(), | ||
() -> delegate.getParquetMetadata(parquetDataSource, fileSize, cacheable, modificationTime)); | ||
if (fileMetadataCache.getModificationTime() == modificationTime) { | ||
return fileMetadataCache; | ||
} | ||
else { | ||
cache.invalidate(parquetDataSource.getId()); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to be more specific of my previous comments, I think we might need add a couple of junit test cases to cover both valid and invalid cache cases. what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to be more specific of my previous comments, I think we might need add a couple of junit test cases to cover both valid and invalid cache cases. what do you think?
Thanks for the advice, i have added unit tests about that.
b16ee42
to
e94a63e
Compare
Hi, @zhenxiao and @beinan , i've added some tests in |
e94a63e
to
2f7c068
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, thx for the contribution!
Thank you! It's very excited to contribute for our project! |
Test plan
The reason of this pr is detailed in this issue: #17472
Thank you.