viirya commented on code in PR #36328:
URL: https://github.com/apache/spark/pull/36328#discussion_r857065787
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetFilters.scala:
##########
@@ -778,6 +778,38 @@ class ParquetFilters(
)
}
+ case sources.StringEndsWith(name, prefix)
+ if pushDownStringPredicate && canMakeFilterOn(name, prefix) =>
Review Comment:
nit: indent
##########
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetFilters.scala:
##########
@@ -778,6 +778,38 @@ class ParquetFilters(
)
}
+ case sources.StringEndsWith(name, prefix)
+ if pushDownStringPredicate && canMakeFilterOn(name, prefix) =>
+ Option(prefix).map { v =>
+
FilterApi.userDefined(binaryColumn(nameToParquetField(name).fieldNames),
+ new UserDefinedPredicate[Binary] with Serializable {
+ private val strToBinary = Binary.fromReusedByteArray(v.getBytes)
+ override def canDrop(statistics: Statistics[Binary]): Boolean =
false
+ override def inverseCanDrop(statistics: Statistics[Binary]):
Boolean = false
+ override def keep(value: Binary): Boolean = {
+ value != null && UTF8String.fromBytes(value.getBytes).endsWith(
+ UTF8String.fromBytes(strToBinary.getBytes))
+ }
+ }
+ )
+ }
+
+ case sources.StringContains(name, value)
+ if pushDownStringPredicate && canMakeFilterOn(name, value) =>
Review Comment:
ditto
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]