maomaodev commented on code in PR #7476:
URL: https://github.com/apache/kyuubi/pull/7476#discussion_r3805355056
##########
extensions/spark/kyuubi-spark-connector-hive/src/main/scala/org/apache/spark/sql/hive/kyuubi/connector/HiveBridgeHelper.scala:
##########
@@ -119,4 +124,36 @@ object HiveBridgeHelper {
implicit class NamespaceHelper(namespace: Array[String]) {
def quoted: String = namespace.map(quoteIfNeeded).mkString(".")
}
+
+ def orcConvertibleFilters(
+ schema: StructType,
+ caseSensitive: Boolean,
+ dataFilters: Seq[Filter]): Seq[Filter] = {
+ val dataTypeMap = OrcFilters.getSearchableTypeMap(schema, caseSensitive)
+ OrcFilters.convertibleFilters(dataTypeMap, dataFilters)
+ }
+
+ def parquetConvertibleFilters(
+ readDataSchema: StructType,
+ dataFilters: Seq[Filter]): Seq[Filter] = {
+ val sqlConf = SQLConf.get
+ val pushDownDate = sqlConf.parquetFilterPushDownDate
+ val pushDownTimestamp = sqlConf.parquetFilterPushDownTimestamp
+ val pushDownDecimal = sqlConf.parquetFilterPushDownDecimal
+ val pushDownStringPredicate = sqlConf.parquetFilterPushDownStringPredicate
+ val pushDownInFilterThreshold =
sqlConf.parquetFilterPushDownInFilterThreshold
+ val isCaseSensitive = sqlConf.caseSensitiveAnalysis
+ val parquetSchema = new
SparkToParquetSchemaConverter(sqlConf).convert(readDataSchema)
+ val rebaseSpec = RebaseSpec(LegacyBehaviorPolicy.CORRECTED)
Review Comment:
Following the same convention as Spark's own
[ParquetScanBuilder.pushDataFilters](https://github.com/apache/spark/blob/master/sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/v2/parquet/ParquetScanBuilder.scala#L77-L79)
— this ParquetFilters instance is only used by `convertibleFilters(...)` to
decide push-down eligibility, which does not consume `rebaseSpec` at all.
Spark's own code has an inline comment explaining exactly this, I'll port the
same comment here to make the intent explicit.
--
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]