-
Notifications
You must be signed in to change notification settings - Fork 96
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
Inject customizable extraction functions to RegisteredLookupDimension #724
Conversation
d0f86ef
to
6bfdece
Compare
30e2281
to
3649ac1
Compare
keyValueStore, | ||
searchProvider | ||
); | ||
this.registeredLookupExtractionFns = Collections.unmodifiableList(registeredLookupExtractionFns); |
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.
Only this line is effectively changed for this constructor, the rest is Javadoc updates
@NotNull LinkedHashSet<DimensionField> fields, | ||
@NotNull KeyValueStore keyValueStore, | ||
@NotNull SearchProvider searchProvider, | ||
@NotNull List<ExtractionFunction> registeredLookupExtractionFns |
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.
Only this line is effectively changed for this constructor, the rest is Javadoc updates
@@ -17,9 +18,9 @@ default Class getType() { | |||
} | |||
|
|||
/** | |||
* Returns a list of lookups used to configure the Lookup dimension. | |||
* Returns a list of extraction function for the lookup dimension values. |
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.
(sp) extraction functions
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.
Just fix the spelling issue and merge.
3d8f29f
to
c194850
Compare
Thank you for the review and approvals, @michael-mclawhorn @efronbs ! |
Addresses issue #723
Problem
We have a business requirement to return different default value for different registered lookup. To be more specific, here is an example of serialized registered lookup extraction function
API supports lookups with user-defined lookup name as in
"lookup" : "<lookup name>"
. It is, however, not possible for downstream projects to specify the rest of attributes. We need a different default lookup value as in"replaceMissingValueWith" : "<default lookup value>"
for each lookup extraction function.Solution
The cause of this issue is in
DefaultRegisteredLookupDimensionConfig
, we only pass in a list of lookup names. If, instead, we pass in a list ofRegisteredLookupExtractionFunction
, the downstream projects could freely define all of the attributes for a registered lookup extraction function and then configure them in.This PR essentially changes
List<String> lookups
toList<ExtractionFunction> registeredLookupExtractionFns
inDefaultRegisteredLookupDimensionConfig
.@michael-mclawhorn This might have impact on #719