Skip to content

[SPARK-26930][SQL] Tests in ParquetFilterSuite don't verify filter class#23855

Closed
nandorKollar wants to merge 2 commits intoapache:masterfrom
nandorKollar:SPARK-26930
Closed

[SPARK-26930][SQL] Tests in ParquetFilterSuite don't verify filter class#23855
nandorKollar wants to merge 2 commits intoapache:masterfrom
nandorKollar:SPARK-26930

Conversation

@nandorKollar
Copy link
Contributor

What changes were proposed in this pull request?

Add assert to verify predicate class in ParquetFilterSuite

How was this patch tested?

Ran ParquetFilterSuite, tests passed

@nandorKollar
Copy link
Contributor Author

nandorKollar commented Feb 21, 2019

@HyukjinKwon would you mind have a look at this PR and share your thought? The solution is simple (though suboptimal, since it doesn't check the entire filter tree, but that would require a lot more modification in the test code), yet provides more value than before.

@HyukjinKwon
Copy link
Member

@cloud-fan, can you take a quick look before getting this in?

new SparkToParquetSchemaConverter(conf).convert(df.schema), pred)
assert(maybeFilter.isDefined, s"Couldn't generate filter predicate for $pred")
// Doesn't bother checking type parameters here (e.g. `Eq[Integer]`)
maybeFilter.exists(_.getClass === filterClass)
Copy link
Member

Choose a reason for hiding this comment

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

@cloud-fan, to cut it short, ef77003 missed to add an assert. Pushed filters are now like

before: a == 1
after: is not null && a == 1

These are turned into Parquet filters and here, it checks the filter's class. I thought it's overkill to traverse tree and/or whitelisting somehow with more codes. Currently, it simply checks the root filter after disabling the constraint filter.

@HyukjinKwon
Copy link
Member

ok to test

@cloud-fan
Copy link
Contributor

LGTM

@cloud-fan
Copy link
Contributor

ok to test

1 similar comment
@HyukjinKwon
Copy link
Member

ok to test

@SparkQA
Copy link

SparkQA commented Feb 22, 2019

Test build #102608 has finished for PR 23855 at commit 3adf8f2.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@HyukjinKwon
Copy link
Member

Merged to master.

@HyukjinKwon
Copy link
Member

Oh, it was you who reviewed my Parquet PR! :D.

@nandorKollar
Copy link
Contributor Author

Thanks @HyukjinKwon and @cloud-fan for the review! @HyukjinKwon not impossible that I reviewed your PR on Parquet, I'm active there, occasionally do reviews. :)

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.

5 participants