Fix getColumns for Late binding views#74
Merged
bhvkshah merged 1 commit intoaws:masterfrom Dec 16, 2022
Merged
Conversation
... where column is a CASE numeric with null If we have a late binding view defined as example view test_view, the JDBC driver will fail to obtain its schema through the standard JDBC method `DatabaseMetaData.getColumns`, with the following error: `ERROR: invalid input syntax for integer: ""` Testcase: ``` CREATE OR REPLACE VIEW test_view AS WITH test_data AS (SELECT 'value1' AS value UNION ALL SELECT 'value2' AS value) SELECT CASE WHEN value = 'value1' THEN 123.45 END AS numeric_with_null FROM test_data WITH NO SCHEMA BINDING; SELECT * FROM test_view; ``` Initial issue is described in aws#45 Some specific field types in late-binding views cause the Redshift JDBC driver to throw an error on the `getColumns` call when fetching field metadata, but 2.1.0.5 Fix Github issue 45 4c24b47 seems fix some of these cases, but not all. Specifically, a case statement that produces a mix of numeric and null values still results in an error. maybe issue was reintroduced with 2.1.0.8 Fix numeric scale issue with Numeric data type of an external table e080dd6
Contributor
Author
|
@bhvkshah @Brooke-white @iggarish @hyandell Could you please take a look on this PR? |
Contributor
|
@ssheikin Thanks for submitting this PR, we will review this and get back to you as soon as we have an update. |
Contributor
Author
|
@bhvkshah @Brooke-white Have you got a chance to take a look on this pr? |
|
Thank you! |
This was referenced Feb 8, 2023
Closed
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.
... where column is a CASE numeric with null
If we have a late binding view defined as example view test_view, the JDBC driver will fail to obtain its schema through the standard JDBC method
DatabaseMetaData.getColumns, with the following error:ERROR: invalid input syntax for integer: ""Testcase:
Initial issue is described in
#45 Some specific field types in late-binding views cause the Redshift JDBC driver to throw an error on the
getColumnscall when fetching field metadata, but2.1.0.5
Fix Github issue 45
4c24b47
seems fix some of these cases, but not all.
Specifically, a case statement that produces a mix of numeric and null values still results in an error.
maybe issue was reintroduced with
2.1.0.8
Fix numeric scale issue with Numeric data type of an external table e080dd6
Description
Do not parse not existing precision (as i other parts of existing code)
Motivation and Context
#45 was not fixed completely.
Testing
Screenshots (if appropriate)
Types of changes
Checklist
mvn installsucceedsThis section is not appropriate for this project.
License