cloud-fan commented on a change in pull request #35729:
URL: https://github.com/apache/spark/pull/35729#discussion_r820821473
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/analysis/ResolveHints.scala
##########
@@ -250,14 +250,24 @@ object ResolveHints {
}
private def createRebalance(hint: UnresolvedHint): LogicalPlan = {
+ def createRebalancePartitions(
+ partitionExprs: Seq[Any], initialNumPartitions: Option[Int]):
RebalancePartitions = {
+ val invalidParams =
partitionExprs.filter(!_.isInstanceOf[UnresolvedAttribute])
+ if (invalidParams.nonEmpty) {
+ val hintName = hint.name.toUpperCase(Locale.ROOT)
+ throw QueryCompilationErrors.invalidHintParameterError(hintName,
invalidParams)
+ }
+ RebalancePartitions(partitionExprs.map(_.asInstanceOf[Expression]),
hint.child,
+ initialNumPartitions)
Review comment:
```suggestion
RebalancePartitions(
partitionExprs.map(_.asInstanceOf[Expression]),
hint.child,
initialNumPartitions)
```
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]