HeartSaVioR commented on a change in pull request #23854: [SPARK-22000][SQL]
Address missing Upcast in JavaTypeInference.deserializerFor
URL: https://github.com/apache/spark/pull/23854#discussion_r259650513
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/ScalaReflection.scala
##########
@@ -349,10 +349,18 @@ object ScalaReflection extends ScalaReflection {
// TODO: add walked type path for map
val TypeRef(_, _, Seq(keyType, valueType)) = t
+ val classNameForKey = getClassNameFromType(keyType)
+ val classNameForValue = getClassNameFromType(valueType)
+
+ val newTypePath =
+ s"""- map key class: "$classNameForKey",
+ | value class: "$classNameForValue"""".stripMargin +:
+ walkedTypePath
+
Review comment:
Not strictly, but consistent between `ScalaReflection.deserializeFor` and
`JavaTypeInference.deserializeFor`. It is marked as TODO and symmetric part is
addressed in `JavaTypeInference.deserializeFor` so why not address it to
`ScalaReflection.deserializeFor` too?
If we would like to address this from out of this PR I'll add follow-up PR
against this.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]