Skip to content

Commit

Permalink
Move ExtractPythonUdfs to Analyzer's extendedRules in HiveContext.
Browse files Browse the repository at this point in the history
  • Loading branch information
staple committed Sep 10, 2014
1 parent d49bfb3 commit 7c77fda
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

/**
Expand Down Expand Up @@ -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())

Expand Down

0 comments on commit 7c77fda

Please sign in to comment.