martin-g commented on code in PR #3858:
URL: https://github.com/apache/datafusion-comet/pull/3858#discussion_r3022097649
##########
spark/src/test/scala/org/apache/comet/exec/CometNativeShuffleSuite.scala:
##########
@@ -474,4 +474,27 @@ class CometNativeShuffleSuite extends CometTestBase with
AdaptiveSparkPlanHelper
}
}
}
+
+ test("native datafusion scan - repartition count") {
+ withTempPath { dir =>
+ withSQLConf(CometConf.COMET_ENABLED.key -> "false") {
+ spark
+ .range(1000)
+ .selectExpr("id", "concat('name_', id) as name")
+ .repartition(100)
+ .write
+ .parquet(dir.toString)
+ }
+ withSQLConf(
+ CometConf.COMET_NATIVE_SCAN_IMPL.key ->
CometConf.SCAN_NATIVE_DATAFUSION,
+ CometConf.COMET_EXEC_SHUFFLE_WITH_ROUND_ROBIN_PARTITIONING_ENABLED.key
-> "true") {
+ val testDF = spark.read.parquet(dir.toString).repartition(10)
+ // Actual validation, no crash
+ val count = testDF.count()
+ assert(count == 1000)
+ // Ensure test df evaluated by Comet
+ checkSparkAnswerAndOperator(testDF)
Review Comment:
There is no usage of `count()` here. Is this intentional ?
Another way could be something like:
```scala
val testDF = spark.read.parquet(dir.toString).repartition(10)
val countDF = testDF.selectExpr("count(*) as cnt")
val count = countDF.collect().head.getLong(0)
assert(count == 1000)
checkSparkAnswerAndOperator(countDF)
```
--
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]