alamb commented on code in PR #9420:
URL: https://github.com/apache/arrow-datafusion/pull/9420#discussion_r1510007573
##########
datafusion/functions-array/Cargo.toml:
##########
@@ -38,7 +38,8 @@ path = "src/lib.rs"
[dependencies]
arrow = { workspace = true }
-datafusion-common = { workspace = true, default-features = true }
+arrow-array = { workspace = true }
Review Comment:
I wonder why we need to add arrow-array explicilty? Isn't everything we need
already exported via `arrow`?
##########
datafusion/sqllogictest/test_files/array.slt:
##########
@@ -5549,26 +5549,32 @@ from arrays_range;
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9] [3, 4, 5, 6, 7, 8, 9] [3, 5, 7, 9]
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] [4, 5, 6, 7, 8, 9, 10, 11, 12] [4,
7, 10]
-query ??????
+query ?????????
select range(5),
range(2, 5),
range(2, 10, 3),
range(1, 5, -1),
range(1, -5, 1),
- range(1, -5, -1)
+ range(1, -5, -1),
+ range(DATE '1992-09-01', DATE '1993-03-01', INTERVAL '1' MONTH),
+ range(DATE '1993-02-01', DATE '1993-01-01', INTERVAL '-1' DAY),
+ range(DATE '1989-04-01', DATE '1993-03-01', INTERVAL '1' YEAR)
Review Comment:
Can you please also add tests for null handling?
For example
```sql
range(DATE '1992-09-01', DATE '1993-03-01', NULL,
range(DATE '1992-09-01', NULL , INTERVAL '1' MONTH),
range(NULL, DATE '1993-03-01', INTERVAL '1' MONTH),
```
Also, can you add negative tests (like when start is > stop by the the
interval is positive (I think the code will error in this case, but it would be
good to verify this
```sql
range(DATE '1993-03-01', DATE '1989-04-01', INTERVAL '1' YEAR)
range(, DATE '1989-04-01', DATE '1993-03-01', INTERVAL '-1' YEAR)
```
--
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]