We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bd08239 commit 050bb97Copy full SHA for 050bb97
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/trees/TreeNode.scala
@@ -280,7 +280,8 @@ abstract class TreeNode[BaseType <: TreeNode[BaseType]] {
280
*/
281
def makeCopy(newArgs: Array[AnyRef]): this.type = attachTree(this, "makeCopy") {
282
try {
283
- val defaultCtor = getClass.getConstructors.head
+ // Skip no-arg constructors that are just there for kryo.
284
+ val defaultCtor = getClass.getConstructors.find(_.getParameterTypes.size != 0).head
285
if (otherCopyArgs.isEmpty) {
286
defaultCtor.newInstance(newArgs: _*).asInstanceOf[this.type]
287
} else {
0 commit comments