andygrove commented on code in PR #910:
URL: https://github.com/apache/datafusion-comet/pull/910#discussion_r1747208959
##########
spark/src/test/scala/org/apache/comet/CometExpressionSuite.scala:
##########
@@ -146,6 +146,32 @@ class CometExpressionSuite extends CometTestBase with
AdaptiveSparkPlanHelper {
}
}
+ test("date_add with scalar") {
+ Seq(true, false).foreach { dictionaryEnabled =>
+ withTempDir { dir =>
+ val path = new Path(dir.toURI.toString, "test.parquet")
+ makeParquetFileAllTypes(path, dictionaryEnabled = dictionaryEnabled,
10000)
+ withParquetTable(path.toString, "tbl") {
+ checkSparkAnswerAndOperator(
+ "SELECT _2 FROM tbl WHERE _20 + 2 > CAST('1970-01-02' AS DATE)")
Review Comment:
A simpler approach for testing here may be to just use the expression in a
projection. For example:
```sql
SELECT _20 + 2 FROM tbl
```
I also tried testing with subtracting instead of adding and the test failed
because we don't support `date_sub` (I had assumed that `date_add` would accept
negative values). We could add `date_sub` as a part of this PR or as a separate
PR.
--
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]