File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed
kotlin-spark-api/src/main/kotlin/org/jetbrains/kotlinx/spark/api Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -463,8 +463,24 @@ object KotlinTypeInference {
463463 )
464464 }
465465
466- currentType.isSubtypeOf<Map <* , * >? > () -> TODO ()
467- currentType.isSubtypeOf< scala.collection.Map <* , * >? > () -> TODO ()
466+ currentType.isSubtypeOf<Map <* , * >? > () || currentType.isSubtypeOf< scala.collection.Map <* , * >? > () -> {
467+ val keyEncoder = encoderFor(
468+ currentType = tArguments[0 ].type!! ,
469+ seenTypeSet = seenTypeSet,
470+ typeVariables = typeVariables,
471+ )
472+ val valueEncoder = encoderFor(
473+ currentType = tArguments[1 ].type!! ,
474+ seenTypeSet = seenTypeSet,
475+ typeVariables = typeVariables,
476+ )
477+ AgnosticEncoders .MapEncoder (
478+ /* clsTag = */ ClassTag .apply<Map <* , * >>(jClass),
479+ /* keyEncoder = */ keyEncoder,
480+ /* valueEncoder = */ valueEncoder,
481+ /* valueContainsNull = */ tArguments[1 ].type!! .isMarkedNullable,
482+ )
483+ }
468484
469485 kClass.isData -> {
470486 if (currentType in seenTypeSet) throw IllegalStateException (" Circular reference detected for type $currentType " )
You can’t perform that action at this time.
0 commit comments