-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Oracle output does not support NUMBER datatype #246
Comments
Thank you for the information! |
@MichaelMih Could you tell me Oracle version, JDBC driver version and DDL? |
I checked it with oracle jdbc driver 12.1.0.1 and 12.2.0.1.
The ResultSetMetaData.getColumnType of NUMBER column returns 2 - which maps
to java.sql.Types.NUMERIC
Sample table:
create table test2(a number(1));
Sample code:
PreparedStatement ps = connection.prepareStatement("select * from test2");
ResultSet rs = ps.executeQuery();
ResultSetMetaData resultSetMetaData = rs.getMetaData();
System.out.println(resultSetMetaData.getColumnType(1));
The output is:
2
the method that builds the JdbcSchema with this sqlType is:
org.embulk.input.jdbc.JdbcInputConnection.getSchemaOfResultMetadata :
...
int sqlType = metadata.getColumnType(index);
...
|
@MichaelMih But I can't reproduce the problem yet. As you wrote, embulk-input-jdbc uses Anyway, I've created the PR #247 to fix this issue. |
When trying to load to oracle using any mode (default, direct or oci) then getting 👍 Caused by: java.sql.SQLException: Unsupported type : NUMBER
at org.embulk.output.oracle.DirectBatchInsert.prepare(DirectBatchInsert.java:138)
I guess that the way to solve it is to add NUMBER in the switch statement just above DECIMAL - they both should be treated the same way.
The text was updated successfully, but these errors were encountered: