From b16e3b5624970869743ce756d3d3d9949c0dc790 Mon Sep 17 00:00:00 2001 From: Grigory Pomadchin Date: Mon, 11 Apr 2022 21:47:11 -0400 Subject: [PATCH] Replace transformDown with transform for the better DataBricks compat --- .../spark/spatial/rules/SpatialFilterPushdownRules.scala | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/spatial-index/src/main/scala/com/azavea/hiveless/spark/spatial/rules/SpatialFilterPushdownRules.scala b/spatial-index/src/main/scala/com/azavea/hiveless/spark/spatial/rules/SpatialFilterPushdownRules.scala index 88afa83..2d44431 100644 --- a/spatial-index/src/main/scala/com/azavea/hiveless/spark/spatial/rules/SpatialFilterPushdownRules.scala +++ b/spatial-index/src/main/scala/com/azavea/hiveless/spark/spatial/rules/SpatialFilterPushdownRules.scala @@ -38,7 +38,14 @@ object SpatialFilterPushdownRules extends Rule[LogicalPlan] { @transient private[this] lazy val logger = getLogger def apply(plan: LogicalPlan): LogicalPlan = - plan.transformDown { + // format: off + /** + * transform is an alias to transformDown + * The transformDown usage causes the following error on DataBricks 9.1: + * * java.lang.NoClassDefFoundError: LogicalPlan,transformDown(Lscala/PartialFunction;)Lorg/apache/spark/sql/catalyst/plans/logical/LogicalPlan; + */ + // format: on + plan.transform { case f @ Filter(condition: HiveGenericUDF, plan) if condition.of[ST_Intersects] => try { val Seq(extentExpr, geometryExpr) = condition.children