[Java] [JDBC] [Exceptions] Mapping Runtime Exceptions to SQL Exceptions#24
Open
escobargabriel wants to merge 27 commits intoflight-jdbc-driverfrom
Open
[Java] [JDBC] [Exceptions] Mapping Runtime Exceptions to SQL Exceptions#24escobargabriel wants to merge 27 commits intoflight-jdbc-driverfrom
escobargabriel wants to merge 27 commits intoflight-jdbc-driverfrom
Conversation
rafael-telles
requested changes
Mar 28, 2022
|
|
||
| private void assertMapStates(CallStatus timedOut, String code) { | ||
| FlightRuntimeException flightRuntimeException = | ||
| timedOut.withDescription("Failure in connection: %s").toRuntimeException(); |
Owner
There was a problem hiding this comment.
Remove withDescription as it's not relevant to the test
| private void assertMapStates(CallStatus timedOut, String code) { | ||
| FlightRuntimeException flightRuntimeException = | ||
| timedOut.withDescription("Failure in connection: %s").toRuntimeException(); | ||
| SQLException map = |
| */ | ||
| public class FlightToJDBCExceptionMapper { | ||
|
|
||
| private static final String UNAUTHENTICATED = "28000"; |
Owner
There was a problem hiding this comment.
Lets prefix these contants to avoid ambiguation with FlightStatusCode members
rafael-telles
requested changes
Mar 28, 2022
Owner
There was a problem hiding this comment.
Can we remove the trailing : on all exceptions please?
Owner
There was a problem hiding this comment.
Suggested change
| throw FlightToJDBCExceptionMapper.map(e, "Failed to access the resource: "); | |
| throw FlightToJDBCExceptionMapper.map(e, "Failed retrieve next row on ResultSet"); |
Owner
There was a problem hiding this comment.
Suggested change
| throw FlightToJDBCExceptionMapper.map(e, "Failed to access catalogs: "); | |
| throw FlightToJDBCExceptionMapper.map(e, "Failed to get catalogs"); |
jduo
approved these changes
Mar 28, 2022
532d91f to
59148df
Compare
* Remove scope from 'hamcrest' dependency on java/pom.xml * Use flight top-level module on parent pom.xml instead of declaring each one * Avoid using getStatement inside StatementContext methods * Make StatementContext.getQuery() return String * Minor fixes on pom.xml * Move 'os-maven-plugin' to parent pom.xml * Update protobuf generation on pom.xml files * Use ClassLoader#getResource to get network.properties on TestFlightSql * Bind to any ephemeral port on TestFlightSql * Move JDBC-Arrow type default conversion from JdbcToArrowConfig to JdbcToArrowUtils * Micro-optimization: initialize ArrayList with the right size * Fix null-check on PreparedStatement#setParameters * Avoid wrapping vector into a ImmutableList and then into an ArrayList on FlightSqlExample#getTablesRoot * Remove null-check on VectorSchemaRoot on FlightSqlClient#setParameters() * Remove the need of separate cache for ResultSets * Add missing 'final' modifiers
…les and query execution methods. (apache#226) This add an auxiliary class FlightSqlColumnMetadata meant to read and write known metadata for Arrow schema fields, such as CATALOG_NAME, SCHEMA_NAME, TABLE_NAME, PRECISION, SCALE, IS_AUTO_INCREMENT, IS_CASE_SENSITIVE, IS_READ_ONLY and IS_SEARCHABLE.
e5e852f to
3a38fb8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Mapping the runtime exceptions to throw SQL exceptions with appropriate error code.