Oracle Batch import with Date Column is slower and inserts incorrect 1/1/1970 for all date rows
To reproduce the issue with Batch Import
1. Create the below table with the SQL
2. Do a batch import with the attached file with Batch Size = 1000 and Transaction Type = Batch
3. The Import is slow with Batch involving DATE data type.
4. You can see that an incorrect date 1/1/1970 is being inserted instead of the correct date
See below for reference
We were using PreparedStatement.setTime to process DATE columns, which caused the wrong values to be inserted. My first attempt to fix the problem was to replace the setTime call with setDate. This fixed the problem with inserting incorrect values, but it still took minutes to batch import 1 million records.
Then I changed the prepared statement to use the parameter TO_DATE(?,'YYYY-MM-DD HH24:MI:SS') for DATE columns and call setString to pass in the DATE values. This inserts the correct values and the batch import takes seconds only to process 1 million records.
This fix has been applied to both DATE and TIMESTAMP columns for Oracle batch import.
Checked in to ADS-14.0.0 and trunk.
Issue #11639 |
Closed |
Fixed |
Resolved |
Completion |
No due date |
Fixed Build ADS 14.0.8-5 |
No time estimate |
We were using PreparedStatement.setTime to process DATE columns, which caused the wrong values to be inserted. My first attempt to fix the problem was to replace the setTime call with setDate. This fixed the problem with inserting incorrect values, but it still took minutes to batch import 1 million records.
Then I changed the prepared statement to use the parameter TO_DATE(?,'YYYY-MM-DD HH24:MI:SS') for DATE columns and call setString to pass in the DATE values. This inserts the correct values and the batch import takes seconds only to process 1 million records.
This fix has been applied to both DATE and TIMESTAMP columns for Oracle batch import.
Checked in to ADS-14.0.0 and trunk.