ulysses-you commented on a change in pull request #25464: [SPARK-28746][SQL]
Add partitionby hint for sql queries
URL: https://github.com/apache/spark/pull/25464#discussion_r319787726
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveHints.scala
##########
@@ -137,28 +137,83 @@ object ResolveHints {
}
/**
- * COALESCE Hint accepts name "COALESCE" and "REPARTITION".
- * Its parameter includes a partition number.
+ * COALESCE Hint accepts name "COALESCE" and "REPARTITION" and
"REPARTITIONBYRANGE".
+ * Its parameter includes a partition number and columns.
*/
object ResolveCoalesceHints extends Rule[LogicalPlan] {
- private val COALESCE_HINT_NAMES = Set("COALESCE", "REPARTITION")
+ private val COALESCE_HINT_NAMES = Set("COALESCE", "REPARTITION",
"REPARTITIONBYRANGE")
+
+ /**
+ * same with repartition api
+ */
+ private def createRepartition(
+ shuffle: Boolean, h: UnresolvedHint): LogicalPlan = {
+ def createRepartitionByExpression(
+ numPartitions: Int, exprs: Seq[Any], h: UnresolvedHint):
RepartitionByExpression = {
+ val errExprs = exprs.filter(!_.isInstanceOf[UnresolvedAttribute])
Review comment:
We cannot match `Column` here because of module dependency.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]