cloud-fan commented on a change in pull request #35729:
URL: https://github.com/apache/spark/pull/35729#discussion_r820824614
##########
File path:
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/ResolveHintsSuite.scala
##########
@@ -313,13 +321,45 @@ class ResolveHintsSuite extends AnalysisTest {
UnresolvedHint("REBALANCE", Seq(UnresolvedAttribute("a")),
table("TaBlE")),
testRelation)
+ checkAnalysisWithoutViewWrapper(
+ UnresolvedHint("REBALANCE", Seq(1, UnresolvedAttribute("a")),
table("TaBlE")),
+ testRelation)
+
+ checkAnalysisWithoutViewWrapper(
+ UnresolvedHint("REBALANCE", Seq(Literal(1), UnresolvedAttribute("a")),
table("TaBlE")),
+ testRelation)
+
checkAnalysisWithoutViewWrapper(
UnresolvedHint("REBALANCE", Seq.empty, table("TaBlE")),
testRelation)
+
+ checkAnalysisWithoutViewWrapper(
+ UnresolvedHint("REBALANCE", 1 :: Nil, table("TaBlE")),
+ testRelation)
}
assertAnalysisError(
- UnresolvedHint("REBALANCE", Seq(Literal(1)), table("TaBlE")),
+ UnresolvedHint("REBALANCE", Seq(Literal(1), Literal(1)), table("TaBlE")),
+ Seq("Hint parameter should include columns"))
+
+ assertAnalysisError(
+ UnresolvedHint("REBALANCE", Seq(1, Literal(1)), table("TaBlE")),
Seq("Hint parameter should include columns"))
}
+
+ test("SPARK-38410: Support specify initial partition number for rebalance") {
+ withSQLConf(SQLConf.SHUFFLE_PARTITIONS.key -> "3") {
+ assert(RebalancePartitions(Nil, table("TaBlE"))
Review comment:
This doesn't really test the hint resolution... Can we test with
`UnresolvedHint`?
--
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]