sunchao opened a new issue, #7493:
URL: https://github.com/apache/arrow-datafusion/issues/7493
### Describe the bug
In the `PrimitiveGroupsAccumulator` implementation, currently the `evaluate`
method is implemented as following:
```rust
fn evaluate(&mut self, emit_to: EmitTo) -> Result<ArrayRef> {
let values = emit_to.take_needed(&mut self.values);
let nulls = self.null_state.build(emit_to);
let values = PrimitiveArray::<T>::new(values.into(), Some(nulls));
// no copy
adjust_output_array(&self.data_type, Arc::new(values))
}
```
Note that the `values` array is initialized with the generic parameter `T`,
which, for timestamp types like `TimestampMicrosecondType`, will not have
timezone info. There is a `adjust_output_array` method later to fix a similar
issue for decimal type, but currently it doesn't handle other cases like
timestamp.
This would potentially cause a mismatch between the data type of the Arrow
array and the data type in the required schema.
### To Reproduce
Added a test to reproduce the issue.
### Expected behavior
Timezone information should be properly passed to the result Arrow array in
`PrimitiveGroupsAccumulator.evaluate`
### Additional context
_No response_
--
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]