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

Holman Lan commented on DRILL-4420:
-----------------------------------

Hello Laurent,

We have a few more question.

ODBC and JDBC support SQLGetTypeInfo and DatabaseMetaData.getTypeInfo() 
respectively for reporting information about data types supported by the data 
source. Would there be a method in the new Drill client API to retrieve such 
information?

In contrib/native/client/src/clientlib/fieldmeta.cpp there is a static function 
"static std::string getSQLType(common::MinorType type, common::DataMode mode)". 
Is the returned string value meant to be the typename of the particular data 
type, i.e. the typename can be used in CREATE TABLE statement or the CAST 
function? Does ColumnMetadata::getDataType() return the same string as static 
function getSQLType in fieldmeta.cpp for the same data type?
We would like to make sure we correctly map data types reported by Drill to SQL 
type with the correct typename native to Drill. For example mapping MinorType 
common::FLOAT8 to SQL_DOUBLE with typename bing "DOUBLE". The typename is 
important to us as this is what the ODBC/JDBC application/user need to use in 
the CREATE TABLE statement. In addition we would like to also make sure we 
report the metadata consistently between SQLGetTypeInfo, SQLColumns, and result 
set metadata for ODBC and DatabaseMetaData.getTypeInfo(), 
DatabaseMetaData.getColumns() and ResultSetMetaData for JDBC.

Further to the question regarding signed and unsigned data types. The typename 
is what the user/ODBC application/JDBC application would use in CREATE TABLE 
statement. For example "CREATE TABLE tinyint_table(c1 TINYINT)". If the 
typename is always TINYINT, how would the user specify in the CREATE TABLE 
statement that a signed or unsigned TINYINT columns is to be created? Or is the 
expectation that particular data source (e.g. Hive) only support either signed 
or unsigned TINYINT but not both, and the sign-ness is implied depending on the 
data source?

Thanks,
Holman



> C client and ODBC driver should move to using the new metadata methods 
> provided by DRILL-4385
> ---------------------------------------------------------------------------------------------
>
>                 Key: DRILL-4420
>                 URL: https://issues.apache.org/jira/browse/DRILL-4420
>             Project: Apache Drill
>          Issue Type: Sub-task
>            Reporter: Jacques Nadeau
>




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

Reply via email to