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

[SPARK-5187][SQL] Fix caching of tables with HiveUDFs in the WHERE clause

Author: Michael Armbrust <michael@databricks.com>

Closes #3987 from marmbrus/hiveUdfCaching and squashes the following commits:

8bca2fa [Michael Armbrust] [SPARK-5187][SQL] Fix caching of tables with HiveUDFs in the WHERE clause
parent 77106df6
No related branches found
No related tags found
No related merge requests found
...@@ -158,4 +158,10 @@ class CachedTableSuite extends QueryTest { ...@@ -158,4 +158,10 @@ class CachedTableSuite extends QueryTest {
uncacheTable("src") uncacheTable("src")
assert(!isMaterialized(rddId), "Uncached in-memory table should have been unpersisted") assert(!isMaterialized(rddId), "Uncached in-memory table should have been unpersisted")
} }
test("CACHE TABLE with Hive UDF") {
sql("CACHE TABLE udfTest AS SELECT * FROM src WHERE floor(key) = 1")
assertCached(table("udfTest"))
uncacheTable("udfTest")
}
} }
...@@ -44,7 +44,7 @@ import scala.language.implicitConversions ...@@ -44,7 +44,7 @@ import scala.language.implicitConversions
import org.apache.spark.sql.catalyst.types.DecimalType import org.apache.spark.sql.catalyst.types.DecimalType
class HiveFunctionWrapper(var functionClassName: String) extends java.io.Serializable { case class HiveFunctionWrapper(functionClassName: String) extends java.io.Serializable {
// for Serialization // for Serialization
def this() = this(null) def this() = this(null)
......
...@@ -53,7 +53,7 @@ import scala.language.implicitConversions ...@@ -53,7 +53,7 @@ import scala.language.implicitConversions
* *
* @param functionClassName UDF class name * @param functionClassName UDF class name
*/ */
class HiveFunctionWrapper(var functionClassName: String) extends java.io.Externalizable { case class HiveFunctionWrapper(var functionClassName: String) extends java.io.Externalizable {
// for Serialization // for Serialization
def this() = this(null) def this() = this(null)
......
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