[
https://issues.apache.org/jira/browse/DRILL-2469?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14700618#comment-14700618
]
Daniel Barclay (Drill) commented on DRILL-2469:
-----------------------------------------------
Some metadata method was incorrectly indicating that the datatype was SMALLINT
(corresponding to getShort).
> 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)