-
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
Add extraction function to selector dimensional filter to allow lookup on filter #617
Conversation
4d86199
to
d70f6fb
Compare
d70f6fb
to
3c15734
Compare
|
||
this.dimension = dimension; | ||
if (dimension instanceof ExtractionFunctionDimension) { | ||
extractionFunction = ((ExtractionFunctionDimension) dimension).getExtractionFunction().get(); |
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.
Are we sure .get()
returns a extracFn?
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.
or null
@@ -20,7 +21,19 @@ | |||
* @param value Value of the filter | |||
*/ | |||
public SelectorFilter(Dimension dimension, String value) { | |||
super(dimension, DefaultFilterType.SELECTOR); | |||
this(dimension, value, null); |
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.
how about calling super that takes 2 args?
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.
right
@@ -0,0 +1,45 @@ | |||
package com.yahoo.bard.webservice.druid.model.filter |
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.
Missing header
/** | ||
* Test selector filter serialization. | ||
*/ | ||
class SelectorFilterSpec extends Specification{ |
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.
space before {
* @param dimension Dimension to apply the extraction to | ||
* @param value Value of the filter | ||
* @param extractionFn Extraction function to be applied on dimension | ||
* |
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.
extra line
0ec5084
to
fcfd260
Compare
fcfd260
to
b40cdce
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.
👍
@@ -1,3 +1,5 @@ | |||
// Copyright 2017 Yahoo Inc. |
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.
2018
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.
Yahoo Inc. is not valid also anymore I 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.
Seems pretty solid. A few small bugs.
We should follow up with @gyehuda to find out how we should be copywriting oath opensource code going forward.
import java.util.Objects; | ||
|
||
/** | ||
* Filter for matching a dimension using some specific Extraction function. | ||
* | ||
* @deprecated Use other dimensional filters with extractionFn specified instead |
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.
Use javadoc {@link} to other class.
*/ | ||
public SelectorFilter withExtractionFn(ExtractionFunction extractionFn) { | ||
return new SelectorFilter(getDimension(), value, extractionFn); | ||
} |
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.
Other withers need to be updated to preserve the extractionFn value.
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.
Needs a quick rereview.
Asserting the name Yahoo Inc. is the correct copyright holder for code published before Yahoo's name was formally changed in June 2017. Between then and January 2018 you could publish new files using Yahoo Inc. or more accurately Yahoo Holdings Inc. Either was fine. Going forward:
At the end of the day, this code is open source under a permissive license. Everyone in the world can use this code. We simply try to be accurate because we care about quality. |
No description provided.