[ 
https://issues.apache.org/jira/browse/ARROW-10748?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17240472#comment-17240472
 ] 

Liya Fan commented on ARROW-10748:
----------------------------------

The reason is that when the calendar/time zone information is present, Arrow 
type system creates a TimeStampTZMilliVector by default. When the calendar/time 
zone information is absent, Arrow type system creates a TimeStampMilliVector.
The JDBC adapter, on the other hand, always creates a consumer for 
TimeStampTZMilliVector, which causes the ClassCastException.

I have prepared a PR that should be able to fix this problem. 
[~dclong] Maybe you can try it with your code. 

BTW, another effort is on-going to enable more flexible conversions between 
JDBC types and Arrow vector types. Please see 
http://github.com/apache/arrow/pull/8597/files

> TimeStampMilliVector cannot be cast to TimeStampMilliTZVector
> -------------------------------------------------------------
>
>                 Key: ARROW-10748
>                 URL: https://issues.apache.org/jira/browse/ARROW-10748
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: Java
>            Reporter: Benjamin Du
>            Assignee: Liya Fan
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> I tried to leverage `org.apache.arrow.adapter.jdbc.JdbcToArrow.sqlToArrow` to 
> query a Hive table but got the following error message on Timestamp columns. 
> Notice that Date columns works well. 
>  
>  {{java.lang.ClassCastException: java.lang.ClassCastException: 
> org.apache.arrow.vector.TimeStampMilliVector cannot be cast to 
> org.apache.arrow.vector.TimeStampMilliTZVector}}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to