Github user yhuai commented on a diff in the pull request:
https://github.com/apache/spark/pull/9364#discussion_r43453219
--- Diff:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/plans/logical/partitioning.scala
---
@@ -38,3 +38,11 @@ case class SortPartitions(sortExpressions:
Seq[SortOrder], child: LogicalPlan)
*/
case class RepartitionByExpression(partitionExpressions: Seq[Expression],
child: LogicalPlan)
extends RedistributeData
+
+/**
+ * This method repartitions data using [[Expression]]s into
`numPartitions`. If numPartitions is
+ * less than zero, a default is used. Otherwise this behaves identically
to RepartitionByExpression.
+ */
+case class PartitionByExpression(partitionExpressions: Seq[Expression],
+ child: LogicalPlan, numPartitions: Int =
-1)
+ extends RedistributeData
--- End diff --
oh, we need to avoid of using `Option` in the public API `distributeBy`
because it is not Java friendly. So, I am good if we use `numPartitions: Int`
internally as well.
---
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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]