You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "andygrove (via GitHub)" <gi...@apache.org> on 2025/10/26 18:11:31 UTC

Re: [PR] fix: Mark SortOrder with floating-point as incompatible [datafusion-comet]

andygrove commented on code in PR #2650:
URL: https://github.com/apache/datafusion-comet/pull/2650#discussion_r2463949281


##########
spark/src/test/scala/org/apache/comet/CometExpressionSuite.scala:
##########
@@ -60,6 +61,70 @@ class CometExpressionSuite extends CometTestBase with AdaptiveSparkPlanHelper {
   val DIVIDE_BY_ZERO_EXCEPTION_MSG =
     """Division by zero. Use `try_divide` to tolerate divisor being 0 and return NULL instead"""
 
+  test("sort floating point with negative zero") {
+    val schema = StructType(
+      Seq(
+        StructField("c0", DataTypes.FloatType, true),
+        StructField("c1", DataTypes.DoubleType, true)))
+    val df = FuzzDataGenerator.generateDataFrame(
+      new Random(42),
+      spark,
+      schema,
+      1000,
+      DataGenOptions(generateNegativeZero = true))
+    df.createOrReplaceTempView("tbl")
+
+    withSQLConf(CometConf.getExprAllowIncompatConfigKey("SortOrder") -> "false") {
+      checkSparkAnswerAndFallbackReason(
+        "select * from tbl order by 1, 2",
+        "unsupported range partitioning sort order")

Review Comment:
   I filed a follow-up issue for improving the fallback reason to show the root cause
   
   https://github.com/apache/datafusion-comet/issues/2651



-- 
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: github-unsubscribe@datafusion.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org