You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@drill.apache.org by "Rahul Challapalli (JIRA)" <ji...@apache.org> on 2015/03/15 22:41:38 UTC

[jira] [Updated] (DRILL-2469) JDBC : Accessing interval type through JDBC is not supported

     [ https://issues.apache.org/jira/browse/DRILL-2469?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rahul Challapalli updated DRILL-2469:
-------------------------------------
    Attachment: fewtypes.parquet

> JDBC : Accessing interval type through JDBC is not supported
> ------------------------------------------------------------
>
>                 Key: DRILL-2469
>                 URL: https://issues.apache.org/jira/browse/DRILL-2469
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Client - JDBC
>            Reporter: Rahul Challapalli
>            Assignee: Daniel Barclay (Drill)
>             Fix For: Future
>
>         Attachments: fewtypes.parquet
>
>
> git.commit.id.abbrev=7b4c887
> Query :
> {code}
> SELECT cast(f1.`interval_col` as interval day) AS `INTERVALDAYCOL`, cast(f1.`interval_col` as interval month) AS `INTERVALMONTHCOL`, cast(f1.`interval_col` as interval year) AS `INTERVALYEARCOL` FROM dfs.jdbctesting.`fewtypes.parquet` f1
> {code}
> While accessing interval types, JDBC currently returns 'SMALLINT' for the below call. Postgres actually returns 'interval'
> {code}
> resultSetMetaData.getColumnTypeName(i);
> {code}
> However when we try to fetch the column, we get the below error
> {code}
> resultSet.getShort(1);
> org.apache.drill.exec.vector.accessor.AbstractSqlAccessor$InvalidAccessException: Requesting class of type short for an object of type INTERVALDAY:REQUIRED is not allowed.
> 	at org.apache.drill.exec.vector.accessor.AbstractSqlAccessor.getShort(AbstractSqlAccessor.java:82)
> 	at org.apache.drill.exec.vector.accessor.IntervalDayAccessor.getShort(IntervalDayAccessor.java:87)
> 	at org.apache.drill.exec.vector.accessor.BoundCheckingAccessor.getShort(BoundCheckingAccessor.java:98)
> 	at org.apache.drill.jdbc.AvaticaDrillSqlAccessor.getShort(AvaticaDrillSqlAccessor.java:81)
> 	at net.hydromatic.avatica.AvaticaResultSet.getShort(AvaticaResultSet.java:217)
> {code}
> I attached the data file used. Let me know if you have nay questions



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)