aiguofer commented on issue #37021:
URL: https://github.com/apache/arrow/issues/37021#issuecomment-1666169351
Cool that makes sense!
I've been digging more into this and I'm a bit confused. It seems like the
default is to set the timezone associated with the `config.calendar` to regular
`TIMESTAMP` w/o TZ.
Shouldn't the TZ be `null` for `TIMESTAMP` and then set the TZ based on the
`config.calendar` like this (in Kotlin):
```
Types.TIMESTAMP -> ArrowType.Timestamp(TimeUnit.MILLISECOND,
null)
Types.TIMESTAMP_WITH_TIMEZONE ->
ArrowType.Timestamp(TimeUnit.MILLISECOND, defaultCalendar.timeZone.id)
```
I tried doing this but then I got an error in `JdbcToArrowUtils.getConsumer`
because of:
```
case Timestamp:
if (config.getCalendar() == null) {
return TimestampConsumer.createConsumer((TimeStampMilliVector)
vector, columnIndex, nullable);
} else {
return TimestampTZConsumer.createConsumer((TimeStampMilliTZVector)
vector, columnIndex, nullable, calendar);
}
```
it seems to me like that should be
```
case Timestamp:
if (((ArrowType.Timestamp) arrowType).getTimezone() == null) {
return TimestampConsumer.createConsumer((TimeStampMilliVector)
vector, columnIndex, nullable);
} else {
return TimestampTZConsumer.createConsumer((TimeStampMilliTZVector)
vector, columnIndex, nullable, calendar);
}
```
If this seems reasonable I'd be happy to start a 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]