Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,26 @@ class InternalApi(

object SedonaContext {

private def customOptimizationsWithSession(sparkSession: SparkSession) =
Seq(
new TransformNestedUDTParquet(sparkSession),
private def customOptimizationsWithSession(sparkSession: SparkSession) = {
val optimizations = Seq(
new SpatialFilterPushDownForGeoParquet(sparkSession),
new SpatialTemporalFilterPushDownForStacScan(sparkSession))

val versionParts =
sparkSession.version
.split('.')
.map(s => scala.util.Try(s.takeWhile(_.isDigit).toInt).getOrElse(0))
val major = versionParts.lift(0).getOrElse(0)
val minor = versionParts.lift(1).getOrElse(0)
if (major < 4 || (major == 4 && minor < 1)) {
// SPARK-48942: nested UDTs crash the vectorized Parquet reader on Spark < 4.1.
// SPARK-52651 fixes this in Spark 4.1+ by recursively stripping UDTs in ColumnVector.
new TransformNestedUDTParquet(sparkSession) +: optimizations
} else {
optimizations
}
}

def create(sqlContext: SQLContext): SQLContext = {
create(sqlContext.sparkSession)
sqlContext
Expand Down
Loading