Skip to content

Commit

Permalink
[SPARK-5187][SQL] Fix caching of tables with HiveUDFs in the WHERE cl…
Browse files Browse the repository at this point in the history
…ause

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
  • Loading branch information
marmbrus committed Jan 10, 2015
1 parent 77106df commit 3684fd2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,4 +158,10 @@ class CachedTableSuite extends QueryTest {
uncacheTable("src")
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")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import scala.language.implicitConversions

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
def this() = this(null)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ import scala.language.implicitConversions
*
* @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
def this() = this(null)

Expand Down

0 comments on commit 3684fd2

Please sign in to comment.