alamb commented on code in PR #11907:
URL: https://github.com/apache/datafusion/pull/11907#discussion_r1711836257
##########
datafusion/functions-nested/src/range.rs:
##########
@@ -166,8 +165,8 @@ impl ScalarUDFImpl for GenSeries {
match args[0].data_type() {
Int64 => make_scalar_function(|args| gen_range_inner(args,
true))(args),
Date32 => make_scalar_function(|args| gen_range_date(args,
true))(args),
- _ => {
- exec_err!("unsupported type for range")
+ dt => {
+ exec_err!("unsupported type for range: {}", dt)
Review Comment:
Maybe we could explicitly mention the types that are supported:
```suggestion
exec_err!("unsupported type for range. Expected Int64 or
Date32, got: {}", dt)
```
##########
datafusion/functions-nested/src/range.rs:
##########
@@ -311,39 +310,54 @@ fn gen_range_date(args: &[ArrayRef], include_upper: bool)
-> Result<ArrayRef> {
Some(as_interval_mdn_array(&args[2])?),
);
- let mut values = vec![];
- let mut offsets = vec![0];
+ // values are date32s
+ let values_builder = Date32Builder::new();
Review Comment:
👍 I think this is a very nice formulation
--
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]