Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: should functionClassName be still var?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, its mutated below by our custom deserialization.
On Jan 9, 2015 4:31 PM, "Kousuke Saruta" [email protected] wrote:

In sql/hive/v0.13.1/src/main/scala/org/apache/spark/sql/hive/Shim13.scala
#3987 (diff):

@@ -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 {

nit: should functionClassName be still var?


Reply to this email directly or view it on GitHub
https://github.com/apache/spark/pull/3987/files#r22753114.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I see. It's externalaizable.

// for Serialization
def this() = this(null)

Expand Down