Github user jaceklaskowski commented on a diff in the pull request: https://github.com/apache/spark/pull/14435#discussion_r73334167 --- Diff: sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/basicLogicalOperators.scala --- @@ -731,6 +909,20 @@ case class Sample( } override protected def otherCopyArgs: Seq[AnyRef] = isTableSample :: Nil + + override def sql: String = child match { + case SubqueryAlias(alias, _: NonSQLPlan) => + val repeatable = if (withReplacement) s" REPEATABLE ($seed)" else "" + s"$alias TABLESAMPLE(${upperBound * 100} PERCENT)$repeatable" + + case SubqueryAlias(alias, grandChild) => + val repeatable = if (withReplacement) s" REPEATABLE ($seed)" else "" + s"${grandChild.sql} TABLESAMPLE(${upperBound * 100} PERCENT)$repeatable $alias" + + case _ => + val repeatable = if (withReplacement) s" REPEATABLE ($seed)" else "" --- End diff -- `repeatable` repeated three times (and don't think it's on purpose despite the name :))
--- 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