Github user cloud-fan commented on a diff in the pull request: https://github.com/apache/spark/pull/18284#discussion_r122120954 --- Diff: sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/trees/TreeNodeSuite.scala --- @@ -146,6 +154,23 @@ class TreeNodeSuite extends SparkFunSuite { assert(actual === Dummy(None)) } + test("mapChildren should only works on children") { + val children = Seq((Literal(1), Literal(2))) + val notChildren = Seq((Literal(3), Literal(4))) + val before = SeqTupleExpression(children, notChildren) + val toZero: PartialFunction[Expression, Expression] = { case Literal(_, _) => Literal(0) } + val expect = SeqTupleExpression(Seq((Literal(0), Literal(0))), notChildren) + + var actual = before transformDown toZero + assert(actual === expect) + + actual = before transformUp toZero + assert(actual === expect) + + actual = before transform toZero --- End diff -- or we can testing `mapChildren` directly
--- 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