Skip to content
Snippets Groups Projects
Commit de4836f8 authored by Michael Armbrust's avatar Michael Armbrust
Browse files

[SPARK-5868][SQL] Fix python UDFs in HiveContext and checks in SQLContext

Author: Michael Armbrust <michael@databricks.com>

Closes #4657 from marmbrus/pythonUdfs and squashes the following commits:

a7823a8 [Michael Armbrust] [SPARK-5868][SQL] Fix python UDFs in HiveContext and checks in SQLContext
parent 9d281fa5
No related branches found
No related tags found
No related merge requests found
......@@ -113,6 +113,7 @@ class SQLContext(@transient val sparkContext: SparkContext)
protected[sql] lazy val analyzer: Analyzer =
new Analyzer(catalog, functionRegistry, caseSensitive = true) {
override val extendedResolutionRules =
ExtractPythonUdfs ::
sources.PreWriteCheck(catalog) ::
sources.PreInsertCastAndRename ::
Nil
......@@ -1059,7 +1060,7 @@ class SQLContext(@transient val sparkContext: SparkContext)
@DeveloperApi
protected[sql] class QueryExecution(val logical: LogicalPlan) {
lazy val analyzed: LogicalPlan = ExtractPythonUdfs(analyzer(logical))
lazy val analyzed: LogicalPlan = analyzer(logical)
lazy val withCachedData: LogicalPlan = cacheManager.useCachedData(analyzed)
lazy val optimizedPlan: LogicalPlan = optimizer(withCachedData)
......
......@@ -205,6 +205,9 @@ case class EvaluatePython(
extends logical.UnaryNode {
def output = child.output :+ resultAttribute
// References should not include the produced attribute.
override def references = udf.references
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment