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 @@ -628,7 +628,7 @@ object ScalaReflection extends ScalaReflection {
/*
* Retrieves the runtime class corresponding to the provided type.
*/
def getClassFromType(tpe: Type): Class[_] = mirror.runtimeClass(tpe.erasure.typeSymbol.asClass)
def getClassFromType(tpe: Type): Class[_] = mirror.runtimeClass(tpe.typeSymbol.asClass)
Copy link
Member Author

Choose a reason for hiding this comment

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

this is the main change


case class Schema(dataType: DataType, nullable: Boolean)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ case class RepeatedData(
mapFieldNull: scala.collection.Map[Int, java.lang.Long],
structField: PrimitiveData)

case class SpecificCollection(l: List[Int])

/** For testing Kryo serialization based encoder. */
Copy link
Member Author

Choose a reason for hiding this comment

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

cleanup: found this unused class whilst going over the code

class KryoSerializable(val value: Int) {
override def hashCode(): Int = value
Expand Down Expand Up @@ -107,6 +105,12 @@ class UDTForCaseClass extends UserDefinedType[UDTCaseClass] {
}
}

case class PrimitiveValueClass(wrapped: Int) extends AnyVal
case class ReferenceValueClass(wrapped: ReferenceValueClass.Container) extends AnyVal
object ReferenceValueClass {
case class Container(data: Int)
}

class ExpressionEncoderSuite extends PlanTest with AnalysisTest {
OuterScopes.addOuterScope(this)

Expand Down Expand Up @@ -290,6 +294,12 @@ class ExpressionEncoderSuite extends PlanTest with AnalysisTest {
ExpressionEncoder.tuple(intEnc, ExpressionEncoder.tuple(intEnc, longEnc))
}

encodeDecodeTest(
PrimitiveValueClass(42), "primitive value class")

encodeDecodeTest(
ReferenceValueClass(ReferenceValueClass.Container(1)), "reference value class")

productTest(("UDT", new ExamplePoint(0.1, 0.2)))

test("nullable of encoder schema") {
Expand Down