Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Merge remote-tracking branch 'upstream/master' into refactor-jdbc-filter
  • Loading branch information
viirya committed Dec 31, 2015
commit cb7ce21150e08e12e5eca3e5d08cfa4f2a105adc
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ private[sql] object JDBCRDD extends Logging {
case Or(f1, f2) =>
// We can't compile Or filter unless both sub-filters are compiled successfully.
// It applies too for the following And filter.
// If we can make sure compileFilter supports all filters, we can remove this check.
val or = Seq(f1, f2).map(compileFilter(_)).flatten
Copy link
Member

Choose a reason for hiding this comment

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

Please add tests in case of failing to compile sub-filters.
And also, what is an concrete example for that?

Copy link
Member Author

Choose a reason for hiding this comment

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

Do we already support all filters here?

Copy link
Member

Choose a reason for hiding this comment

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

I think that this pr includes all the implemented filters in o.a.s.sources.filters.

Copy link
Member Author

Choose a reason for hiding this comment

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

I added a test for that using EqualNullSafe.

Copy link
Member

Choose a reason for hiding this comment

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

My bad and I understood.
Actually, I'm not sure how to handle EqualNullSafe. Most the recent databases support IS NOT DISTINCT FROM corresponding to EqualNullSafe in SQL99 though, older databases do not.
ISTM that following prs consider this.

Copy link
Member

Choose a reason for hiding this comment

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

Oh actually I opened a PR for EqualNullSafe here already few months ago. #8743

Copy link
Member

Choose a reason for hiding this comment

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

Oh great. If #8743 merged, I think it could simplify the And/Or entries in compileFilters.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good to know that.

if (or.size == 2) {
or.map(p => s"($p)").mkString(" OR ")
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.