Github user maropu commented on a diff in the pull request: https://github.com/apache/spark/pull/14181#discussion_r70767897 --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala --- @@ -154,8 +154,12 @@ class SimpleTestOptimizer extends Optimizer( object PushProjectThroughSample extends Rule[LogicalPlan] { def apply(plan: LogicalPlan): LogicalPlan = plan transform { // Push down projection into sample - case Project(projectList, Sample(lb, up, replace, seed, child)) => - Sample(lb, up, replace, seed, Project(projectList, child))() + case proj @ Project(projectList, Sample(lb, up, replace, seed, child)) => + if (!projectList.exists(_.find(!_.deterministic).nonEmpty)) { --- End diff -- oh, your idea is smarter. I'll fix this.
--- 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