cloud-fan commented on a change in pull request #32932:
URL: https://github.com/apache/spark/pull/32932#discussion_r657099143
##########
File path:
sql/catalyst/src/test/scala/org/apache/spark/sql/catalyst/analysis/ResolveHintsSuite.scala
##########
@@ -295,4 +296,28 @@ class ResolveHintsSuite extends AnalysisTest {
caseSensitive = true)
}
}
+
+ test("SPARK-35786: Support optimize repartition by expression in AQE") {
+ checkAnalysisWithoutViewWrapper(
+ UnresolvedHint("REBALANCE_PARTITIONS", Seq(UnresolvedAttribute("a")),
table("TaBlE")),
+ RebalancePartitions(Seq(AttributeReference("a", IntegerType)()),
testRelation))
+
+ checkAnalysisWithoutViewWrapper(
+ UnresolvedHint("REBALANCE_PARTITIONS", Seq.empty, table("TaBlE")),
+ RebalancePartitions(Seq.empty, testRelation))
+
+ withSQLConf(SQLConf.ADAPTIVE_EXECUTION_ENABLED.key -> "false") {
+ checkAnalysisWithoutViewWrapper(
+ UnresolvedHint("REBALANCE_PARTITIONS", Seq(UnresolvedAttribute("a")),
table("TaBlE")),
+ testRelation)
+
+ checkAnalysisWithoutViewWrapper(
+ UnresolvedHint("REBALANCE_PARTITIONS", Seq.empty, table("TaBlE")),
+ testRelation)
+ }
+
+ assertAnalysisError(
+ UnresolvedHint("REBALANCE_PARTITIONS", Seq(Literal(1)), table("TaBlE")),
Review comment:
not related to this PR, I'm wondering if we should support `date(ts)` as
the partition expression, instead of plain columns. cc @sunchao
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]