Disable loading lookups by default in CompactionTask#16420
Disable loading lookups by default in CompactionTask#16420cryptoe merged 17 commits intoapache:masterfrom
Conversation
|
|
||
| // Return params: <context, default LookupLoadingSpec, expected LookupLoadingSpec> | ||
| Object[][] params = new Object[][]{ | ||
| // Default spec is returned in the case of context not having the lookup keys. |
There was a problem hiding this comment.
I wonder if the intention was to name the set of config somehow; you could use: Named.of("default", ... ) to name parameters
There was a problem hiding this comment.
Sorry, I didn't get it. Could you please elaborate? Thanks!
Not sure if this helps, but the intention here was just to have parameterized test as it would be cleaner than having separate test methods for the different combinations. So provideParamsForTestCreateFromContext method is just supplying params to testGetLookupLoadingSpecFromContext test via @MethodSource("provideParamsForTestCreateFromContext").
There was a problem hiding this comment.
that's great and fine ; but instead of leaving comments about a param's intentions - its better to name it with Named ; so a more descriptive name will be shown when the testcase is run - an SO example is here
There was a problem hiding this comment.
@kgyrtkirk I see.
The above test was refactored into non-parameterized tests, so this should be fine, but will keep that in mind for future code changes.
kfaraz
left a comment
There was a problem hiding this comment.
Left one test related comment, rest of the changes look good.
|
Changes look good to me. @kgyrtkirk , @cryptoe , do you have any further feedback? |
cryptoe
left a comment
There was a problem hiding this comment.
The description seems outdated. Can you please update @Akshat-Jain
|
This patch failed on the group |
|
The cds check passed on the penultimate commit on this PR (https://github.com/apache/druid/actions/runs/9061792112/job/24906027048), and the latest commit didn't have anything other than updating an error message in a couple of files (e6e92a4). Also this PR doesn't touch the cds part at all, hence was merged. |
Description
This PR updates CompactionTask to not load any lookups by default, unless
transformSpecis present.If transformSpec is present, we will make the decision based on context values, loading all lookups by default. This is done to ensure backward compatibility since transformSpec can reference lookups.
If transform spec is not present and no context value is passed, we donot load any lookup.
This behavior can be overridden by supplying
lookupLoadingModeandlookupsToLoadin the task context.Other changes/refactoring:
LookupLoadingSpec#getSpecFromContext.Task#getLookupLoadingSpecto returnLookupLoadingSpec.getSpecFromContext(getContext(), LookupLoadingSpec.ALL). The defaultALLensures that no existing behavior is broken, unless context has been overridden. Making this change inTaskinterface prevents us from having to make this change in a bunch of tasks that are spawned by CompactionTask.Test Plan
lookupLoadingModeandlookupsToLoad- validated that the lookups in all tasks (compaction + spawned) were loaded as per the overridden context. This would help achieve any use-cases where lookups are needed during compaction.This PR has: