From 7c77fda45dc0a2f32c6b75cc216aac9af517d1c3 Mon Sep 17 00:00:00 2001 From: Aaron Staple Date: Wed, 10 Sep 2014 07:56:38 -0700 Subject: [PATCH] Move ExtractPythonUdfs to Analyzer's extendedRules in HiveContext. --- .../scala/org/apache/spark/sql/hive/HiveContext.scala | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveContext.scala b/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveContext.scala index 09602697e9bd7..e0be09e6793ea 100644 --- a/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveContext.scala +++ b/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveContext.scala @@ -263,7 +263,11 @@ class HiveContext(sc: SparkContext) extends SQLContext(sc) { @transient override protected[sql] lazy val analyzer = new Analyzer(catalog, functionRegistry, caseSensitive = false) { - override val extendedRules = catalog.CreateTables :: catalog.PreInsertionCasts :: Nil + override val extendedRules = + catalog.CreateTables :: + catalog.PreInsertionCasts :: + ExtractPythonUdfs :: + Nil } /** @@ -355,8 +359,6 @@ class HiveContext(sc: SparkContext) extends SQLContext(sc) { /** Extends QueryExecution with hive specific features. */ protected[sql] abstract class QueryExecution extends super.QueryExecution { - // TODO: Utilize extendedRules in the analyzer instead of overriding things here. - override lazy val optimizedPlan = optimizer(ExtractPythonUdfs(analyzed)) override lazy val toRdd: RDD[Row] = executedPlan.execute().map(_.copy())