-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Javascript filter with multiple columns #2210
Javascript filter with multiple columns #2210
Conversation
…-with-multiple-columns
I found I made some mistakes on my test code |
@JsonProperty("function") String function | ||
) | ||
{ | ||
Preconditions.checkArgument(dimension != null, "dimension must not be null"); | ||
Preconditions.checkArgument(dimension != null || dimensions != null, "dimension or dimensions must not be 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.
xor should take care of these two checks
|
||
public class JavaScriptDimFilter implements DimFilter | ||
{ | ||
private final String dimension; | ||
private final String[] dimensions; | ||
private final String function; | ||
|
||
@JsonCreator | ||
public JavaScriptDimFilter( |
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 to make two constructor? But his will need opinions from others because I don't know well on guava.
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.
Guice, not guava, I mean.
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 also not familiar with Jackson,
but, I experienced the problem at deserialization of Json string when multiple constructors are used.
Generally, it's implemented in accordant with current implementation but cartesian is still looks painful. I think we should reorder filters and merge bitmap from simple filter with one from complex like this to minimize the pain (when AND filter is applied). But it can be handled in following issue. |
Updated based on the review comments. |
private final String function; | ||
|
||
@JsonCreator | ||
public JavaScriptDimFilter( | ||
// for backwards compatibility | ||
@JsonProperty("dimension") String 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.
let's remove dimension and only have dimensions
Also, can we make dimensions a List of String?
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.
@fjy Can we ignore backward compatibility?
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.
This is going into 0.9.0 with other API changes so I think we can in this case
But would be good to get some other feedback here
This PR fixes #2187
It is implemented like nested loop self-join.
So, if the number of columns increases, it would take much time.
For backward compatibility, usage of javascript filter with one column is maintained.
Currently, complement() of roaring bitmap does not work correctly yet,
test code with NotFilter is commented temporarily.