Skip to content
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

Closed

Conversation

sirpkt
Copy link
Contributor

@sirpkt sirpkt commented Jan 6, 2016

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.

@sirpkt sirpkt closed this Jan 6, 2016
@sirpkt
Copy link
Contributor Author

sirpkt commented Jan 6, 2016

I found I made some mistakes on my test code
so I will reopen after fix the test code

@sirpkt sirpkt reopened this Jan 6, 2016
@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");
Copy link
Contributor

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

@xvrl
Copy link
Member

xvrl commented Jan 6, 2016

@sirpkt complement() in roaring bitmap has been fixed in #2198, so you should rebase your changes on latest master and uncomment your test.

@sirpkt
Copy link
Contributor Author

sirpkt commented Jan 7, 2016

I found that complement bug is not fixed completely with #2198 so made another issue #2218

@sirpkt
Copy link
Contributor Author

sirpkt commented Jan 7, 2016

I think #2217 looks more general so it is better to close this PR.
However, @navis, if you do not mind, how about to include my test cases in #2217 ?

@sirpkt sirpkt closed this Jan 7, 2016
@sirpkt
Copy link
Contributor Author

sirpkt commented Jan 11, 2016

As @navis mentioned in #2217 , we decided to keep both patch as each has its own advantage in different cases.
So, I reopen the PR.

@sirpkt sirpkt reopened this Jan 11, 2016

public class JavaScriptDimFilter implements DimFilter
{
private final String dimension;
private final String[] dimensions;
private final String function;

@JsonCreator
public JavaScriptDimFilter(
Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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.

@navis
Copy link
Contributor

navis commented Jan 12, 2016

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.

@sirpkt
Copy link
Contributor Author

sirpkt commented Jan 12, 2016

Updated based on the review comments.
By the way, @navis I totally agree with you that cartesian is really painful
and hope your patch relieves it.

private final String function;

@JsonCreator
public JavaScriptDimFilter(
// for backwards compatibility
@JsonProperty("dimension") String dimension,
Copy link
Contributor

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?

Copy link
Contributor

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?

Copy link
Contributor

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

@navis
Copy link
Contributor

navis commented Jan 19, 2016

@fjy Merged this into #2217. I'll address comments you've mentioned in that. I think we can close this.

@fjy
Copy link
Contributor

fjy commented Jan 19, 2016

@navis @sirpkt Okay, closing this and reviewing #2217

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

I would like JavaScript filters to be able to work on multiple columns
5 participants