[ https://issues.apache.org/jira/browse/SQOOP-467?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13246754#comment-13246754
]
Cheolsoo Park commented on SQOOP-467:
-------------------------------------
Reading the Oracle SQL reference,
{quote}
BINARY_FLOAT is a 32-bit, single-precision floating-point number datatype. Each BINARY_FLOAT
value requires 5 bytes, including a length byte.
BINARY_DOUBLE is a 64-bit, double-precision floating-point number datatype. Each BINARY_DOUBLE
value requires 9 bytes, including a length byte.
{quote}
I think that it makes sense to map BINARY_FLOAT and BINARY_BOUBLE to java float and java double
respectively.
Since these are Oracle-specific types, we can do the mapping in OracleManager just like we
do with TIMESTAMPTZ and TIMESTAMPLTZ. Probably we can add the following code to the dbToJavaType()
method of OracleManager:
{code}
// check if it is BINARY_FLOAT
dbType = getDatabaseType(typeClass, "BINARY_FLOAT");
if (sqlType == dbType) {
return "Float";
}
// check if it is BINARY_DOUBLE
dbType = getDatabaseType(typeClass, "BINARY_DOUBLE");
if (sqlType == dbType) {
return "Double";
}
{code}
According to some tests that I quickly wrote up, this seems to work.
Please let me know if anyone thinks otherwise.
> Add support for Oracle BINARY_FLOAT and BINARY_DOUBLE data types
> ----------------------------------------------------------------
>
> Key: SQOOP-467
> URL: https://issues.apache.org/jira/browse/SQOOP-467
> Project: Sqoop
> Issue Type: Improvement
> Components: connectors
> Affects Versions: 1.4.1-incubating
> Reporter: Prashant Gokhale
>
> I get this error when I try to run import from Oracle table which has columns of type
BINARY_FLOAT and BINARY_DOUBLE.
> {noformat}
> 12/03/23 11:19:05 ERROR orm.ClassWriter: Cannot resolve SQL type 100
> 12/03/23 11:19:05 ERROR orm.ClassWriter: Cannot resolve SQL type 101
> 12/03/23 11:19:05 ERROR orm.ClassWriter: No Java type for SQL type 100 for column B
> 12/03/23 11:19:05 ERROR orm.ClassWriter: No Java type for SQL type 101 for column C
> {noformat}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
|