Github user hvanhovell commented on a diff in the pull request:
https://github.com/apache/spark/pull/20778#discussion_r179464207
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/objects/objects.scala
---
@@ -392,8 +392,44 @@ case class NewInstance(
childrenResolved && !needOuterPointer
}
- override def eval(input: InternalRow): Any =
- throw new UnsupportedOperationException("Only code-generated
evaluation is supported.")
+ private lazy val constructor: (Seq[AnyRef]) => Any = {
+ val paramTypes = arguments.map { expr =>
+ CallMethodViaReflection.typeMapping.getOrElse(expr.dataType,
+ Seq(expr.dataType.asInstanceOf[ObjectType].cls))
+ }
+ val findConstructor = (types: Seq[Seq[Class[_]]]) => {
+ val constructorOption = cls.getConstructors.find { c =>
--- End diff --
How does this compare to JVM resolution rules? The code generated version
will follow those.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]