missing value handling on LookupExtractionFn, Fix for #2775#2785
Closed
b-slim wants to merge 1 commit intoapache:masterfrom
Closed
missing value handling on LookupExtractionFn, Fix for #2775#2785b-slim wants to merge 1 commit intoapache:masterfrom
b-slim wants to merge 1 commit intoapache:masterfrom
Conversation
Contributor
Author
|
@jon-wei checkout this. |
| LookupExtractor lookup = ((LookupExtractionFn) this.getExtractionFn()).getLookup(); | ||
| // case ReplaceMissingValueWith matching the value we can not optimize | ||
| final LookupExtractionFn lookupExtractionFn = (LookupExtractionFn) this.getExtractionFn(); | ||
| if (Strings.emptyToNull(lookupExtractionFn.getReplaceMissingValueWith()) == Strings.emptyToNull(value)) { |
Contributor
There was a problem hiding this comment.
It's fine to leave out the emptyToNull() call on Strings.emptyToNull(lookupExtractionFn.getReplaceMissingValueWith(), since the constructor of FunctionalExtraction already does that:
public FunctionalExtraction(
final Function<String, String> extractionFunction,
final boolean retainMissingValue,
final String replaceMissingValueWith,
final boolean injective
)
{
this.retainMissingValue = retainMissingValue;
this.replaceMissingValueWith = Strings.emptyToNull(replaceMissingValueWith);
Contributor
|
@b-slim I've made essentially the same fix in this PR: Can we use this implementation, if you plan on backporting this to 0.9.0? |
Contributor
Author
|
@jon-wei both implems lead to the same path, if you prefer your way i am ok, have you already sent the PR ? or sham i update this ? |
Contributor
|
I have the fix in this PR, which seems like it's close to being merged: I can do the backport 0.9.0 if you'd like. |
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix for Issue #2775
fix optimize when we have ReplaceMissingValueWith or retainMissingValue. Correct path is to push down the filter if we have retainMissingValue or ReplaceMissingValueWith is matching with the value.