luoyuxia commented on code in PR #3322:
URL: https://github.com/apache/fluss/pull/3322#discussion_r3248506945
##########
fluss-spark/fluss-spark-common/src/main/scala/org/apache/fluss/spark/utils/SparkPartitionPredicate.scala:
##########
@@ -53,54 +50,17 @@ object SparkPartitionPredicate {
}
def filterPartitions(
+ tableInfo: TableInfo,
partitionInfos: Seq[PartitionInfo],
partitionPredicate: Option[FlussPredicate]): Seq[PartitionInfo] =
partitionPredicate match {
case None => partitionInfos
- case Some(predicate) => partitionInfos.filter(p =>
predicate.test(toPartitionRow(p)))
+ case Some(predicate) =>
+ val rowType = PartitionUtils.partitionRowType(tableInfo)
+ partitionInfos.filter {
+ p =>
+ predicate.test(
Review Comment:
For DATE, that produces Fluss internal Integer day values, and
LeafPredicate.get(...) also reads DATE fields as int.
However, Spark DATE literals are converted to LocalDate in
SparkPredicateConverter, because RPC serialization expects that shape. So a
query like:
CREATE TABLE t (id BIGINT, dt DATE) PARTITIONED BY (dt); SELECT * FROM t
WHERE dt = DATE '2026-01-02'; can hit LocalDate.compareTo(Integer) during local
partition pruning and fail with ClassCastException instead of pruning correctly.
--
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]