Github user yhuai commented on a diff in the pull request: https://github.com/apache/spark/pull/11658#discussion_r56272606 --- Diff: sql/hive/src/main/scala/org/apache/spark/sql/hive/SQLBuilder.scala --- @@ -109,23 +128,6 @@ class SQLBuilder(logicalPlan: LogicalPlan, sqlContext: SQLContext) extends Loggi case Limit(limitExpr, child) => s"${toSQL(child)} LIMIT ${limitExpr.sql}" - case p: Sample if p.isTableSample => - val fraction = math.min(100, math.max(0, (p.upperBound - p.lowerBound) * 100)) - p.child match { - case m: MetastoreRelation => - val aliasName = m.alias.getOrElse("") - build( - s"`${m.databaseName}`.`${m.tableName}`", - "TABLESAMPLE(" + fraction + " PERCENT)", - aliasName) - case s: SubqueryAlias => - val aliasName = if (s.child.isInstanceOf[SubqueryAlias]) s.alias else "" - val plan = if (s.child.isInstanceOf[SubqueryAlias]) s.child else s - build(toSQL(plan), "TABLESAMPLE(" + fraction + " PERCENT)", aliasName) - case _ => - build(toSQL(p.child), "TABLESAMPLE(" + fraction + " PERCENT)") - } --- End diff -- Explain the reason?
--- 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