drill-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Barclay (Drill) (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (DRILL-2128) DatabaseMetaData.getColumns() has wrong type for DATA_TYPE
Date Tue, 10 Mar 2015 20:54:38 GMT

     [ https://issues.apache.org/jira/browse/DRILL-2128?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Daniel Barclay (Drill) updated DRILL-2128:
------------------------------------------
    Description: 
The {{DATA_TYPE}} column in the result set returned by {{DatabaseMetaData.getColumns(...)}}
contains type names instead of integer type codes from {{java.sql.Types}}.

Additional, column {{TYPE_NAME}} is missing.

(See the result set table description in [http://docs.oracle.com/javase/8/docs/api/java/sql/DatabaseMetaData.html#getColumns-java.lang.String-java.lang.String-java.lang.String-java.lang.String-].)



  was:
Drill's implementation of {{DatabaseMetaData.getColumns(...)}} (currently at {{org.apache.drill.jdbc.MetaImpl.getColumns()}})
doesn't match the JDBC specification (the Javadoc documentation for {{DatabaseMetaData.getColumns(...)}}
(as of Java 7)).  In the returned {{ResultSet}}:

1. Column {{DATA_TYPE}} is of type {{VARCHAR}} (the type name) rather than being of type {{INTEGER}}
(with values per {{java.sql.Types.*}}).
2. Column {{TYPE_NAME}} is missing.
3. Column {{COLUMN_SIZE}} is missing.
4. (Columns after {{DATA_TYPE}} are at incorrect indexes.)
5. Column {{DECIMAL_DIGITS}} is misnamed {{DECIMAL_PRECISION}}.
6. Column {{REMARKS}} is an empty string, but probably should be {{NULL}}.
7. Column {{COLUMN_DEF}} is an empty string, but probably should be {{NULL}}.
8. Column {{CHAR_OCTET_LENGTH}} is always {{4}}, but should be "the maximum number of bytes
in the _column_" for character types .
9. Column {{ORDINAL_POSITION}} is always {{1}}, but should be the index of the specific column.
10. Column {{IS_NULLABLE}} is {{'YES'}}, which doesn't seem to correspond to the value for
{{NULLABLE}} ({{DatabaseMetaData.columnNullableUnknown}}).
11. Column {{SCOPE_CATALOG}} is an empty string, but should be {{NULL}}.
12. Column {{SCOPE_SCHEMA}} is an empty string, but should be {{NULL}}.
13. Column {{SCOPE_TABLE}} is an empty string, but should be {{NULL}}.
14. Column {{SOURCE_DATA_TYPE}} is an empty string, but should be {{NULL}}.

(Other columns to check:

Re {{BUFFER_LENGTH}}, {{SQL_DATA_TYPE}}, and {{SQL_DATETIME_SUB}}:  When JDBC says a column
is not used, are there any requirements on the values (e.g., being {{NULL}})? 

Re {{IS_AUTOINCREMENT}}:  Do we know that a column is not auto-incremented?  If so, the value
could be {{'NO'}} rather than an empty string.

Re {{IS_GENERATEDCOLUMN}}:  Do we know that a column is not generated?  If so, the value could
be {{'NO'}} rather than an empty string.

Re {{NULLABLE}} (and {{IS_NULLABLE}}):  Do know whether a column is nullable or not?  If so,
we could return the specific answer rather that just saying that it's unknown.

)



> DatabaseMetaData.getColumns() has wrong type for DATA_TYPE
> ----------------------------------------------------------
>
>                 Key: DRILL-2128
>                 URL: https://issues.apache.org/jira/browse/DRILL-2128
>             Project: Apache Drill
>          Issue Type: Bug
>          Components: Client - JDBC
>            Reporter: Daniel Barclay (Drill)
>            Assignee: Daniel Barclay (Drill)
>            Priority: Blocker
>             Fix For: 0.9.0
>
>
> The {{DATA_TYPE}} column in the result set returned by {{DatabaseMetaData.getColumns(...)}}
contains type names instead of integer type codes from {{java.sql.Types}}.
> Additional, column {{TYPE_NAME}} is missing.
> (See the result set table description in [http://docs.oracle.com/javase/8/docs/api/java/sql/DatabaseMetaData.html#getColumns-java.lang.String-java.lang.String-java.lang.String-java.lang.String-].)



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

Mime
View raw message