diff --git a/kotlin-spark-api/src/main/kotlin/org/jetbrains/kotlinx/spark/api/Encoding.kt b/kotlin-spark-api/src/main/kotlin/org/jetbrains/kotlinx/spark/api/Encoding.kt index dd28c18f..f557224b 100644 --- a/kotlin-spark-api/src/main/kotlin/org/jetbrains/kotlinx/spark/api/Encoding.kt +++ b/kotlin-spark-api/src/main/kotlin/org/jetbrains/kotlinx/spark/api/Encoding.kt @@ -298,30 +298,30 @@ object KotlinTypeInference { currentType.isSubtypeOf() -> AgnosticEncoders.`JavaBigIntEncoder$`.`MODULE$` currentType.isSubtypeOf() -> AgnosticEncoders.`CalendarIntervalEncoder$`.`MODULE$` currentType.isSubtypeOf() -> AgnosticEncoders.STRICT_LOCAL_DATE_ENCODER() - currentType.isSubtypeOf() -> TODO("User java.time.LocalDate for now.") + currentType.isSubtypeOf() -> TODO("User java.time.LocalDate for now. We'll create a UDT for this.") currentType.isSubtypeOf() -> AgnosticEncoders.STRICT_DATE_ENCODER() currentType.isSubtypeOf() -> AgnosticEncoders.STRICT_INSTANT_ENCODER() - currentType.isSubtypeOf() -> TODO("Use java.time.Instant for now.") - currentType.isSubtypeOf() -> TODO("Use java.time.Instant for now.") + currentType.isSubtypeOf() -> TODO("Use java.time.Instant for now. We'll create a UDT for this.") + currentType.isSubtypeOf() -> TODO("Use java.time.Instant for now. We'll create a UDT for this.") currentType.isSubtypeOf() -> AgnosticEncoders.STRICT_TIMESTAMP_ENCODER() currentType.isSubtypeOf() -> AgnosticEncoders.`LocalDateTimeEncoder$`.`MODULE$` - currentType.isSubtypeOf() -> TODO("Use java.time.LocalDateTime for now.") + currentType.isSubtypeOf() -> TODO("Use java.time.LocalDateTime for now. We'll create a UDT for this.") currentType.isSubtypeOf() -> AgnosticEncoders.`DayTimeIntervalEncoder$`.`MODULE$` - currentType.isSubtypeOf() -> TODO("Use java.time.Duration for now.") + currentType.isSubtypeOf() -> TODO("Use java.time.Duration for now. We'll create a UDT for this.") currentType.isSubtypeOf() -> AgnosticEncoders.`YearMonthIntervalEncoder$`.`MODULE$` - currentType.isSubtypeOf() -> TODO("Use java.time.Period for now.") - currentType.isSubtypeOf() -> TODO("Use java.time.Period for now.") + currentType.isSubtypeOf() -> TODO("Use java.time.Period for now. We'll create a UDT for this.") + currentType.isSubtypeOf() -> TODO("Use java.time.Period for now. We'll create a UDT for this.") currentType.isSubtypeOf() -> AgnosticEncoders.`UnboundRowEncoder$`.`MODULE$` // enums - kClass.isSubclassOf(Enum::class) -> AgnosticEncoders.JavaEnumEncoder(ClassTag.apply(jClass)) + kClass.isSubclassOf(Enum::class) -> AgnosticEncoders.JavaEnumEncoder(ClassTag.apply(jClass)) // TODO test kClass.isSubclassOf(scala.Enumeration.Value::class) -> - AgnosticEncoders.ScalaEnumEncoder(jClass.superclass, ClassTag.apply(jClass)) + AgnosticEncoders.ScalaEnumEncoder(jClass.superclass, ClassTag.apply(jClass)) // udts - currentType.hasAnnotation() -> { + kClass.hasAnnotation() -> { val annotation = jClass.getAnnotation(SQLUserDefinedType::class.java)!! val udtClass = annotation.udt val udt = udtClass.primaryConstructor!!.call()