sunchao commented on code in PR #5614:
URL: https://github.com/apache/datafusion-comet/pull/5614#discussion_r3914120252
##########
spark/src/test/scala/org/apache/comet/CometCodegenSuite.scala:
##########
@@ -210,6 +210,63 @@ class CometCodegenSuite
}
}
+ private def withSequenceTable(f: => Unit): Unit = {
+ withTable("t") {
+ sql("CREATE TABLE t (a INT, b INT, d DATE) USING parquet")
+ sql("INSERT INTO t VALUES (1, 5, DATE'2024-01-01'), (9, 2,
DATE'2024-03-01')")
+ withSQLConf(
+ CometConf.COMET_SCALA_UDF_CODEGEN_ENABLED.key -> "true",
+ CometConf.COMET_EXPLAIN_CODEGEN_ENABLED.key -> "true",
+ CometConf.COMET_EXEC_PROJECT_ENABLED.key -> "true",
+ CometConf.COMET_EXTENDED_EXPLAIN_FORMAT.key ->
+ CometConf.COMET_EXTENDED_EXPLAIN_FORMAT_VERBOSE)(f)
+ }
+ }
+
+ test("sequence with leaf integral args runs natively") {
+ // Integral sequence with column-reference/literal args lowers to the
native spark_sequence
+ // kernel; no codegen-dispatch marker should appear.
+ withSequenceTable {
+ val df = sql("SELECT sequence(a, b), sequence(a, b, 2) FROM t")
Review Comment:
[P2] Use legal bounds in the native-path fixture
`withSequenceTable` also inserts `(a, b) = (9, 2)`, so the second expression
becomes `sequence(9, 2, 2)`. Spark rejects a positive step with descending
bounds, and `checkSparkAnswerAndOperator` first collects the Spark reference
result with Comet disabled. This test therefore raises before the output
comparison or native-path assertion. Could the explicit-step case use a
sign-correct step column or separate ascending/descending inputs, keeping its
arguments as leaves so it still tests the native path? This conclusion is
source-derived; I have not run the suite.
--
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]