You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Benjamin Du (Jira)" <ji...@apache.org> on 2020/11/27 20:26:00 UTC

[jira] [Comment Edited] (ARROW-10748) TimeStampMilliVector cannot be cast to TimeStampMilliTZVector

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

Benjamin Du edited comment on ARROW-10748 at 11/27/20, 8:25 PM:
----------------------------------------------------------------

Below is the (Python) code that I used to query the Hive table. How can I use TimeStampMilliVector instead of TimeStampMilliTZVector? 

 
{code:java}
config = org.apache.arrow.adapter.jdbc.JdbcToArrowConfigBuilder().setAllocator( org.apache.arrow.memory.RootAllocator(sys.maxsize) ).setTargetBatchSize(-1).build() conn = java.sql.DriverManager.getConnection(host, user, pwd) vector_schema_root = org.apache.arrow.adapter.jdbc.JdbcToArrow.sqlToArrow(     conn.prepareStatement(query).executeQuery(), config ) pyarrow.jvm.record_batch(vector_schema_root).to_pandas(){code}
 


was (Author: dclong):
Below is the (Python) code that I used to query the Hive table. How can I use TimeStampMilliVector instead of TimeStampMilliTZVector? 

```

config = org.apache.arrow.adapter.jdbc.JdbcToArrowConfigBuilder().setAllocator(
 org.apache.arrow.memory.RootAllocator(sys.maxsize)
 ).setTargetBatchSize(-1).build()
 conn = java.sql.DriverManager.getConnection(host, user, pwd)
 vector_schema_root = org.apache.arrow.adapter.jdbc.JdbcToArrow.sqlToArrow(

    conn.prepareStatement(query).executeQuery(), config

)
 pyarrow.jvm.record_batch(vector_schema_root).to_pandas()

```

 

> 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
>            Priority: Major
>
> 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)