Github user cloud-fan commented on a diff in the pull request:

    https://github.com/apache/spark/pull/10311#discussion_r47728386
  
    --- Diff: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/ScalaReflection.scala 
---
    @@ -740,4 +721,22 @@ trait ScalaReflection {
         assert(methods.length == 1)
         methods.head.getParameterTypes
       }
    +
    +  protected def getConstructorParas(tpe: Type): Seq[Symbol] = {
    +    val constructorSymbol = tpe.member(nme.CONSTRUCTOR)
    +    val params = if (constructorSymbol.isMethod) {
    +      constructorSymbol.asMethod.paramss
    +    } else {
    +      // Find the primary constructor, and use its parameter ordering.
    +      val primaryConstructorSymbol: Option[Symbol] = 
constructorSymbol.asTerm.alternatives.find(
    +        s => s.isMethod && s.asMethod.isPrimaryConstructor)
    +      if (primaryConstructorSymbol.isEmpty) {
    +        sys.error("Internal SQL error: Product object did not have a 
primary constructor.")
    +      } else {
    +        primaryConstructorSymbol.get.asMethod.paramss
    +      }
    +    }
    +
    +    params.flatten
    --- End diff --
    
    This is for curried constructor, they have more than 1 parameter list and 
we should combine them.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to