-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-44064][SQL] Move NonFateSharingCache from core module to catalyst module
#41622
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
Conversation
In the future, if NonFateSharingCache is used by more other modules, other ways need to be found to make maven test pass |
| */ | ||
|
|
||
| package org.apache.spark.util | ||
| package org.apache.spark.sql.util |
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.
According to the code content, NonFateSharingCache fits org.apache.spark.util instead of org.apache.spark.sql.util because it's more general. WDYT?
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.
I agree but seems like it causes some problem @LuciferYang pointed at here #40982 (comment) if we move this to other modules (and catalyst module only has sql module). It doesn't look so beautiful but I think this is a minimized fix.
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.
Oh, got it. I missed the context. Thanks!
HyukjinKwon
left a comment
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.
I'm fine with this approach but would better need to check https://github.com/apache/spark/pull/41622/files#r1233374951 and the original authors' response.
|
This is actually the limitation of Maven, AFAIK, Gradle does well in this case, not sure about SBT. |
|
@HyukjinKwon @dongjoon-hyun @pan3793 After more thought, I give a new one #41654 In #41654, I added a new apply function for NonFateSharingCache, the new apply function no longer use any Guava related types as input parameters, which can avoid the impact of using the shaded core module during Maven testing, and there is no need to move Does this approach look better? |
|
thanks, @LuciferYang, the new approach looks better |
|
close this one due to #41654 merged |
What changes were proposed in this pull request?
This pr move
NonFateSharingCachefromcoremodule tocatalystto makecatalystmodule can test using maven.Why are the changes needed?
SPARK-43300 introduced
NonFateSharingCachetocoremodule and it only used byCodeGeneratorwhich is incatalystmodule.There are two
applyfuncitons inNonFateSharingCacheand the input parameter ofNonFateSharingCache#applyiscom.google.common.cache.Cache/LoadingCache.The
catalystmodule may use shaded spark-core jar when we do maven testing and in the shaded spark-core jar, the Guava related classes will be relocated fromcom.google.commontoorg.sparkproject.guava, so the input parameter ofNonFateSharingCache#applywill change toorg.sparkproject.guava.cache.Cache/LoadingCache, but the catalyst module has not been shaded yet when do maven testing, soCodeGeneratorwill still use typecom.google.common.cache.Cacheto call theNonFateSharingCache#applyfunction, then this will result in a mismatch of input types when do maven testing and maven test will aborted as follows:So this pr move
NonFateSharingCachefromcoremodule tocatalystfor workaround, this is safe now becauseNonFateSharingCacheis only used bycatalystnow.Does this PR introduce any user-facing change?
No
How was this patch tested?
Before
After