Github user sarutak commented on a diff in the pull request: https://github.com/apache/spark/pull/11301#discussion_r55813906 --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/trees/TreeNode.scala --- @@ -60,20 +61,20 @@ object CurrentOrigin { def reset(): Unit = value.set(Origin()) - def setPosition(line: Int, start: Int): Unit = { + def setPosition(callSite: String, line: Int, start: Int): Unit = { value.set( - value.get.copy(line = Some(line), startPosition = Some(start))) + value.get.copy(callSite = Some(callSite), line = Some(line), startPosition = Some(start))) } def withOrigin[A](o: Origin)(f: => A): A = { + val current = get set(o) - val ret = try f finally { reset() } - reset() + val ret = try f finally { set(current) } ret } } -abstract class TreeNode[BaseType <: TreeNode[BaseType]] extends Product { +abstract class TreeNode[BaseType <: TreeNode[BaseType]] extends Product with Serializable { --- End diff -- Sorry, I said we don't need to make `TreeNode` serializable but it's needed otherwise `origin` is not serialized and origin information like callsite is not in the comment in the generated code when WholeStageCodegen is disabled.
--- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org