[ 
https://issues.apache.org/jira/browse/DRILL-3151?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14603874#comment-14603874
 ] 

Daniel Barclay (Drill) commented on DRILL-3151:
-----------------------------------------------

Patch commit message:

DRILL-3151:  Fix many ResultSetMetaData method return values.

Added ~unit test for ResultSetMetaData implementation.

Made getObject return classes available to implementation of getColumnClassName:
- Added SqlAccessor.getObjectClass() (to put that metadata right next to code 
to which it corresponds rather than in far-away parallel code).
- Added similar AvaticaDrillSqlAccessor.getObjectClass().
- Changed DrillAccessorList.accessors from Accessor[] to 
AvaticaDrillSqlAccessor[] for better access to JDBC getObject return class.
- Extracted return classes from accessors to pass to updateColumnMetaData.
    
Reworked some data type mapping and utilities:
- Added Added Types.getSqlTypeName(...).
- Renamed Types.getJdbcType(...) to getJdbcTypeCode(...)
- Replaced Types.isUnSigned with isJdbcSignedType.
- Fixed various bogus RPC-type XXX -> java.sql.Types.SMALLINT mappings.
- Removed DrillColumnMetaDataList.getJdbcTypeName.
- Moved getAvaticaType up (for bottom-up order).
- Revised DrillColumnMetaDataList.getAvaticaType(...).

MAIN:
- Updated updateColumnMetaData(...) to change many calculations of metadata 
input to ColumnMetaData construction.  [DrillColumnMetaDataList]

Updated other metadata tests per changes.


> ResultSetMetaData not as specified by JDBC (null/dummy value, not ""/etc.)
> --------------------------------------------------------------------------
>
>                 Key: DRILL-3151
>                 URL: https://issues.apache.org/jira/browse/DRILL-3151
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Client - JDBC
>            Reporter: Daniel Barclay (Drill)
>            Assignee: Daniel Barclay (Drill)
>             Fix For: 1.2.0
>
>         Attachments: DRILL-3151.1.patch.txt
>
>
> In Drill's JDBC driver, some ResultSetMetaData methods don't return what JDBC 
> specifies they should return.
> Some cases:
> {{getTableName(int)}}:
> - (JDBC says: {{table name or "" if not applicable}})
> - Drill returns {{null}} (instead of empty string or table name)
> - (Drill indicates "not applicable" even when from named table, e.g., for  
> "{{SELECT * FROM INFORMATION_SCHEMA.CATALOGS}}".)
> {{getSchemaName(int)}}:
> - (JDBC says: {{schema name or "" if not applicable}})
> - Drill returns "{{\-\-UNKNOWN--}}" (instead of empty string or schema name)
> - (Drill indicates "not applicable" even when from named table, e.g., for  
> "{{SELECT * FROM INFORMATION_SCHEMA.CATALOGS}}".)
> {{getCatalogName(int)}}:
> - (JDBC says: {{the name of the catalog for the table in which the given 
> column appears or "" if not applicable}})
> - Drill returns "{{\-\-UNKNOWN--}}" (instead of empty string or catalog name)
> - (Drill indicates "not applicable" even when from named table, e.g., for  
> "{{SELECT * FROM INFORMATION_SCHEMA.CATALOGS}}".)
> {{isSearchable(int)}}:
> - (JDBC says:  {{Indicates whether the designated column can be used in a 
> where clause.}})
> - Drill returns {{false}}.
> {{getColumnClassName(int}}:
> - (JDBC says: {{the fully-qualified name of the class in the Java programming 
> language that would be used by the method ResultSet.getObject to retrieve the 
> value in the specified column. This is the class name used for custom 
> mapping.}})
> - Drill returns "{{none}}" (instead of the correct class name).
> More cases:
> {{getColumnDisplaySize}}
> - (JDBC says (quite ambiguously): {{the normal maximum number of characters 
> allowed as the width of the designated column}})
> - Drill always returns {{10}}!



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

Reply via email to