[
https://issues.apache.org/jira/browse/DRILL-2769?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14709761#comment-14709761
]
Daniel Barclay (Drill) edited comment on DRILL-2769 at 8/24/15 6:19 PM:
------------------------------------------------------------------------
Notes on UnsupportedOperationExceptions (and related RuntimeExceptions) in
current Avatica classes:
- 5 UnsupportedOperationException in ArrayImpl
- 29 UnsupportedOperationException in AvaticaConnection
- 10 Helper.todo() (RuntimeException) in AvaticaDatabaseMetaData
- 21 UnsupportedOperationException in AvaticaStatement
- 4 UnsupportedOperationException in AvaticaPreparedStatement
- 103 UnsupportedOperationException in AvaticaResultSet
(no UnsupportedOperationException or Helper.todo() in: AvaticaFactory,
AvaticaJdbc40Factory, AvaticaJdbc41Factory, AvaticaParameter,
AvaticaPrepareResult, AvaticaResultSetMetaData, BuiltInConnectionProperty,
ByteString, Casing, ColumnMetaData, ConnectionConfig, ConnectionConfigImpl,
ConnectionProperty, ConnectStringParser, Cursor, DriverVersion, Handler,
HandlerImpl, Helper, InternalProperty, Meta, Quoting, UnregisteredDriver)
A few of the "throw new UnsupportedOperationException()" are not directly in
JDBC-defined methods (although most are).
was (Author: dsbos):
Notes on UnsupportedOperationExceptions (and related RuntimeExceptions) in
current Avatica classes:
- 5 UnsupportedOperationException in ArrayImpl
- 29 UnsupportedOperationException in AvaticaConnection
- 10 Helper.todo() (RuntimeException) in AvaticaDatabaseMetaData
- 21 UnsupportedOperationException in AvaticaStatement
- 4 UnsupportedOperationException in AvaticaPreparedStatement
- 103 UnsupportedOperationException in AvaticaResultSet
(no UnsupportedOperationException or Helper.todo() in: AvaticaFactory,
AvaticaJdbc40Factory, AvaticaJdbc41Factory, AvaticaParameter,
AvaticaPrepareResult, AvaticaResultSetMetaData, BuiltInConnectionProperty,
ByteString, Casing, ColumnMetaData, ConnectionConfig, ConnectionConfigImpl,
ConnectionProperty, ConnectStringParser, Cursor, DriverVersion, Handler,
HandlerImpl, Helper, InternalProperty, Meta, Quoting, UnregisteredDriver)
> many(?) JDBC methods throw non-SQLException exceptions (e.g.,
> UnsupportedOperationException, RuntimeException)
> --------------------------------------------------------------------------------------------------------------
>
> Key: DRILL-2769
> URL: https://issues.apache.org/jira/browse/DRILL-2769
> Project: Apache Drill
> Issue Type: Bug
> Reporter: Daniel Barclay (Drill)
> Assignee: Daniel Barclay (Drill)
> Fix For: 1.2.0
>
>
> It seems that many JDBC methods throw exceptions of type
> {{UnsupportedOperationException}} or {{RuntimeException}} to indicate that
> they are not applicable (e.g., Drill's implementation of
> {{Connection.commit()}}, since Drill isn't transactional) or not implemented
> yet (and some throw other {{RuntimeException}}s to indicate other problems ).
> However, these methods should be throwing exceptions of type {{SQLException}}
> (or subclasses thereof).
> The JDBC pattern is to throw {{SQLException}}s, not {{RuntimeException}}s, so
> JDBC client code is not likely to handle {{RuntimeException}}s well.
> (For example, it is suspected that {{Connection.commit()}}'s throwing of
> {{UnsupportedOperationException}} is causing a hang in the JDBC client
> Spotfire.)
> JDBC does provide a {{SQLFeatureNotSupportedException}}. However, it is
> specified to be for when "the JDBC driver does does not support an optional
> JDBC feature." It's not clear how risky it would be to use this exception
> when Drill does not support a _non_-optional JDBC feature.
> (Possibly, some methods that can't really do what JDBC specifies might need
> to just return silently without throwing any exception.)
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)