Skip to content

Implement native in filter#2577

Merged
gianm merged 1 commit intoapache:masterfrom
navis:native-in-filter
Mar 31, 2016
Merged

Implement native in filter#2577
gianm merged 1 commit intoapache:masterfrom
navis:native-in-filter

Conversation

@navis
Copy link
Copy Markdown
Contributor

@navis navis commented Mar 2, 2016

Currently, InDimFilter is translated to "or + selector filters". Value matcher can use hash set for faster filtering.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we add check for null ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

values cannot be null and Strings.nullToEmpty(input) also cannot be null.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

values may contain null, this should match "" but with the current code it will not. Something should be translating null to empty within values.

@nishantmonu51 nishantmonu51 self-assigned this Mar 14, 2016
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can just pass in empty string

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wanted to look same with line 69. I'll address that.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it a allowed for values to be empty set ?
should we consider empty set as equivalent to filtering against null ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could be regarded false for all values imo, but seeing it had thrown exception in OR filter in runtime in original implementation, it would be better to add precondition in InDimFilter not to accept null or empty.

@fjy
Copy link
Copy Markdown
Contributor

fjy commented Mar 14, 2016

👍

@navis navis force-pushed the native-in-filter branch from 535f158 to 66bf72b Compare March 14, 2016 23:53
@nishantmonu51
Copy link
Copy Markdown
Member

👍 after travis, @navis please squash commits.

@navis navis force-pushed the native-in-filter branch from a0b8824 to 3f307be Compare March 21, 2016 02:49
@navis
Copy link
Copy Markdown
Contributor Author

navis commented Mar 21, 2016

@nishantmonu51 squashed

@nishantmonu51
Copy link
Copy Markdown
Member

Ah, It has merge conflicts. @navis can you rebase with the latest master ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO the old signature was better- it enforces at least one value must be passed in. an IN () with empty list seems strange to me and not very meaningful.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the old impl would actually have thrown an exception in this case. It would have tried to construct an empty OrFilter, which isn't allowed.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah I see you're checking this in InDimFilter's constructor. In that case why not keep value, values....

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reverted that

@gianm
Copy link
Copy Markdown
Contributor

gianm commented Mar 24, 2016

would be nice to see some additional tests too, especially tests involving null handling.

@gianm gianm added this to the 0.9.1 milestone Mar 24, 2016
@gianm
Copy link
Copy Markdown
Contributor

gianm commented Mar 28, 2016

Looks good other than some minor comments and a desire for tests.

@navis navis force-pushed the native-in-filter branch from 3f307be to de4d9bc Compare March 30, 2016 07:15
@gianm
Copy link
Copy Markdown
Contributor

gianm commented Mar 30, 2016

👍, looks good once the tests can compile.

BaseFilterTest was adjusted in #2753 such that it could also test filtered aggregators; the tests need to call it a little differently since then.

@navis navis force-pushed the native-in-filter branch from de4d9bc to 108535f Compare March 31, 2016 01:11
@navis
Copy link
Copy Markdown
Contributor Author

navis commented Mar 31, 2016

rebased to master and squashed

@gianm
Copy link
Copy Markdown
Contributor

gianm commented Mar 31, 2016

👍

@gianm gianm merged commit 5f9240f into apache:master Mar 31, 2016
@navis navis deleted the native-in-filter branch March 31, 2016 09:12
sirpkt pushed a commit to sirpkt/druid that referenced this pull request Apr 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants