File tree Expand file tree Collapse file tree 3 files changed +2
-16
lines changed
catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis
core/src/main/scala/org/apache/spark/sql
hive/src/main/scala/org/apache/spark/sql/hive Expand file tree Collapse file tree 3 files changed +2
-16
lines changed Original file line number Diff line number Diff line change @@ -35,19 +35,6 @@ trait FunctionRegistry {
3535 def lookupFunction (name : String , children : Seq [Expression ]): Expression
3636}
3737
38- class OverrideFunctionRegistry (underlying : FunctionRegistry ) extends FunctionRegistry {
39-
40- private val functionBuilders = StringKeyHashMap [FunctionBuilder ](caseSensitive = false )
41-
42- override def registerFunction (name : String , builder : FunctionBuilder ): Unit = {
43- functionBuilders.put(name, builder)
44- }
45-
46- override def lookupFunction (name : String , children : Seq [Expression ]): Expression = {
47- functionBuilders.get(name).map(_(children)).getOrElse(underlying.lookupFunction(name, children))
48- }
49- }
50-
5138class SimpleFunctionRegistry extends FunctionRegistry {
5239
5340 private val functionBuilders = StringKeyHashMap [FunctionBuilder ](caseSensitive = false )
Original file line number Diff line number Diff line change @@ -139,8 +139,7 @@ class SQLContext(@transient val sparkContext: SparkContext)
139139
140140 // TODO how to handle the temp function per user session?
141141 @ transient
142- protected [sql] lazy val functionRegistry : FunctionRegistry =
143- new OverrideFunctionRegistry (FunctionRegistry .builtin)
142+ protected [sql] lazy val functionRegistry : FunctionRegistry = FunctionRegistry .builtin
144143
145144 @ transient
146145 protected [sql] lazy val analyzer : Analyzer =
Original file line number Diff line number Diff line change @@ -371,7 +371,7 @@ class HiveContext(sc: SparkContext) extends SQLContext(sc) {
371371 // Note that HiveUDFs will be overridden by functions registered in this context.
372372 @ transient
373373 override protected [sql] lazy val functionRegistry : FunctionRegistry =
374- new OverrideFunctionRegistry ( new HiveFunctionRegistry (FunctionRegistry .builtin) )
374+ new HiveFunctionRegistry (FunctionRegistry .builtin)
375375
376376 /* An analyzer that uses the Hive metastore. */
377377 @ transient
You can’t perform that action at this time.
0 commit comments