kazuyukitanimura commented on code in PR #3454:
URL: https://github.com/apache/datafusion-comet/pull/3454#discussion_r2914599900
##########
dev/diffs/4.0.1.diff:
##########
@@ -1514,6 +1583,16 @@ index c73e8e16fbb..88cd0d47da3 100644
val items_partitions = Array(identity("price"), identity("id"))
createTable(items, itemsColumns, items_partitions)
sql(s"INSERT INTO testcat.ns.$items VALUES " +
+@@ -390,7 +396,8 @@ class KeyGroupedPartitioningSuite extends
DistributionAndOrderingSuiteBase {
+ assert(collectAllShuffles(df.queryExecution.executedPlan).isEmpty,
+ "should contain no shuffle when sorting by partition values")
+ } else {
+- assert(collectAllShuffles(df.queryExecution.executedPlan).size ==
1,
++ val s = collectAllShuffles(df.queryExecution.executedPlan)
++ assert(s.size == 1,
+ "should contain one shuffle when optimization is disabled")
+ }
+ checkAnswer(df, answer)
Review Comment:
Do we need this part of diff?
##########
dev/diffs/4.0.1.diff:
##########
@@ -3562,7 +3666,7 @@ index f0f3f94b811..d64e4e54e22 100644
+ */
+ protected def enableCometAnsiMode: Boolean = {
+ val v = System.getenv("ENABLE_COMET_ANSI_MODE")
-+ v != null && v.toBoolean
++ if (v != null) v.toBoolean else true
Review Comment:
If enabling by default, is it more like
```
v == null || v == "1" || v.toBoolean
```
##########
dev/diffs/4.0.1.diff:
##########
@@ -1606,7 +1685,32 @@ index d1b11a74cf3..08087c80201 100644
case _ => false
}.isDefined)
}
-@@ -77,7 +78,9 @@ class InsertSortForLimitAndOffsetSuite extends QueryTest
+@@ -47,16 +48,23 @@ class InsertSortForLimitAndOffsetSuite extends QueryTest
+ private def assertHasGlobalLimitExec(plan: SparkPlan): Unit = {
+ assert(find(plan) {
+ case _: GlobalLimitExec => true
++ case _: CometGlobalLimitExec => true
+ case _ => false
+ }.isDefined)
+ }
+
+ private def hasLocalSort(plan: SparkPlan): Boolean = {
+- find(plan) {
++ val b = find(plan) {
+ case GlobalLimitExec(_, s: SortExec, _) => !s.global
+ case GlobalLimitExec(_, ProjectExec(_, s: SortExec), _) => !s.global
++ case CometGlobalLimitExec(_, _, _, _, s: CometSortExec, _) =>
++ !s.originalPlan.asInstanceOf[SortExec].global
Review Comment:
We do not need `b`, I guess we can directly return `find`
--
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]