Github user rdblue commented on a diff in the pull request:
https://github.com/apache/spark/pull/21556#discussion_r198904504
--- Diff:
sql/core/src/main/scala/org/apache/spark/sql/execution/datasources/parquet/ParquetFilters.scala
---
@@ -62,6 +98,30 @@ private[parquet] class ParquetFilters(pushDownDate:
Boolean) {
(n: String, v: Any) => FilterApi.eq(
intColumn(n),
Option(v).map(date =>
dateToDays(date.asInstanceOf[Date]).asInstanceOf[Integer]).orNull)
+ case decimal: DecimalType
+ if pushDownDecimal && (DecimalType.is32BitDecimalType(decimal) &&
!readLegacyFormat) =>
+ (n: String, v: Any) => FilterApi.eq(
+ intColumn(n),
+
Option(v).map(_.asInstanceOf[JBigDecimal].unscaledValue().intValue()
+ .asInstanceOf[Integer]).orNull)
+ case decimal: DecimalType
+ if pushDownDecimal && (DecimalType.is64BitDecimalType(decimal) &&
!readLegacyFormat) =>
+ (n: String, v: Any) => FilterApi.eq(
+ longColumn(n),
+
Option(v).map(_.asInstanceOf[JBigDecimal].unscaledValue().longValue()
+ .asInstanceOf[java.lang.Long]).orNull)
+ case decimal: DecimalType
+ if pushDownDecimal && ((DecimalType.is32BitDecimalType(decimal) &&
readLegacyFormat)
--- End diff --
Please add comments here to explain what differs when `readLegacyFormat` is
true.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]