mickjermsurawong-stripe commented on a change in pull request #33205: URL: https://github.com/apache/spark/pull/33205#discussion_r663576570
########## File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/ScalaReflection.scala ########## @@ -358,17 +417,17 @@ object ScalaReflection extends ScalaReflection { Invoke(obj, "deserialize", ObjectType(udt.userClass), path :: Nil) case t if definedByConstructorParams(t) => - val params = getConstructorParameters(t) - - val cls = getClassFromType(tpe) + val cls = ScalaReflection.getClassFromType(tpe) + val isTypeTuple = isTupleType(tpe) + val unwrappedParams = getConstructorUnwrappedParameters(t, isTypeTuple) - val arguments = params.zipWithIndex.map { case ((fieldName, fieldType), i) => + val arguments = unwrappedParams.zipWithIndex.map { case ((fieldName, fieldType), i) => Review comment: Deserializer expression ########## File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/ScalaReflection.scala ########## @@ -584,8 +643,8 @@ object ScalaReflection extends ScalaReflection { throw QueryExecutionErrors.cannotHaveCircularReferencesInClassError(t.toString) } - val params = getConstructorParameters(t) - val fields = params.map { case (fieldName, fieldType) => + val unwrappedParams = getConstructorUnwrappedParameters(t, tpe) + val fields = unwrappedParams.map { case (fieldName, fieldType) => Review comment: Serializer expression ########## File path: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/ScalaReflection.scala ########## @@ -788,9 +847,9 @@ object ScalaReflection extends ScalaReflection { case t if isSubtype(t, definitions.ByteTpe) => Schema(ByteType, nullable = false) case t if isSubtype(t, definitions.BooleanTpe) => Schema(BooleanType, nullable = false) case t if definedByConstructorParams(t) => - val params = getConstructorParameters(t) + val unwrappedParams = getConstructorUnwrappedParameters(t, tpe) Schema(StructType( - params.map { case (fieldName, fieldType) => + unwrappedParams.map { case (fieldName, fieldType) => Review comment: Get schema type -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org