TheR1sing3un commented on code in PR #14335:
URL: https://github.com/apache/hudi/pull/14335#discussion_r2562560344
##########
hudi-spark-datasource/hudi-spark3.4.x/src/main/scala/org/apache/spark/sql/adapter/Spark3_4Adapter.scala:
##########
@@ -171,7 +173,15 @@ class Spark3_4Adapter extends BaseSpark3Adapter {
RebaseDateTime.RebaseSpec(LegacyBehaviorPolicy.withName(policy))
}
- override def enableParquetFilterPushDownStringPredicate(conf: SQLConf):
Boolean = {
- conf.parquetFilterPushDownStringPredicate
+ override def createParquetFilters(schema: MessageType, storageConf:
StorageConfiguration[_], sqlConf: SQLConf): ParquetFilters = {
+ new ParquetFilters(
+ schema,
+ storageConf.getBoolean(SQLConf.PARQUET_FILTER_PUSHDOWN_DATE_ENABLED.key,
sqlConf.parquetFilterPushDownDate),
+
storageConf.getBoolean(SQLConf.PARQUET_FILTER_PUSHDOWN_TIMESTAMP_ENABLED.key,
sqlConf.parquetFilterPushDownTimestamp),
+
storageConf.getBoolean(SQLConf.PARQUET_FILTER_PUSHDOWN_DECIMAL_ENABLED.key,
sqlConf.parquetFilterPushDownDecimal),
+
storageConf.getBoolean(SQLConf.PARQUET_FILTER_PUSHDOWN_STRING_PREDICATE_ENABLED.key,
sqlConf.parquetFilterPushDownStringPredicate),
Review Comment:
> Or is it a bug that the config is assigned improperly?
In the previous implementation, to mask the version differences,
`PARQUET_FILTER_PUSHDOWN_STRING_STARTSWITH_ENABLED ` was uniformly used as the
configuration item. Because in higher versions, spark >=
3.4,`PARQUET_FILTER_PUSHDOWN_STRING_STARTSWITH_ENABLED` can still be
configured, but the new configuration
`PARQUET_FILTER_PUSHDOWN_STRING_PREDICATE_ENABLED` has a higher priority.
However, it is still possible to make fallback go back to
`PARQUET_FILTER_PUSHDOWN_STRING_STARTSWITH_ENABLED` when this parameter is not
configured. However, after refactoring, the entire logic for setting parameters
is now placed within each version of the spark adapter. Therefore, we no longer
use the uniform `PARQUET_FILTER_PUSHDOWN_STRING_STARTSWITH_ENABLED`, but follow
the spark community's recommendation and prioritize the use of
`PARQUET_FILTER_PUSHDOWN_STRING_PREDICATE_ENABLED` for higher versions.
<img width="981" height="455" alt="image"
src="https://github.com/user-attachments/assets/4a0316e5-96ff-466c-a41a-7c5e16cf47bd"
/>
--
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]