Github user liancheng commented on a diff in the pull request:
https://github.com/apache/spark/pull/5889#discussion_r31828468
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/parquet/ParquetFilters.scala ---
@@ -40,6 +42,25 @@ private[sql] object ParquetFilters {
createFilter(filter)
}.reduceOption(FilterApi.and).map(FilterCompat.get)
}
+
+ case class SetInFilter[T <: Comparable[T]](
+ hSet: Set[T]) extends UserDefinedPredicate[T] with Serializable {
+
+ override def keep(value: T): Boolean = {
+ if (value == null) {
+ return false
+ }
+ return hSet.contains(value)
--- End diff --
Generally we try to avoid using `return` in Scala code. (You may find a
detailed guide [here] [1].) For this method, we'd prefer:
```scala
value != null && hSet.contains(value)
```
BTW, why the name `hSet`? Maybe `valueSet` instead?
[1]: https://github.com/databricks/scala-style-guide
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]