Skip to content

Commit

Permalink
[BugFix][Postgres][DTStack#1463] The cast is bad, only when 'rowConve…
Browse files Browse the repository at this point in the history
…rter' instance of the 'JdbcColumnConverter' should cast.
  • Loading branch information
FlechazoW committed Jan 5, 2023
1 parent 3c72eae commit 95bfcec
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,12 @@ protected void openInternal(int taskNumber, int numTasks) {
LOG.info("write sql:{}", copySql);
}
checkUpsert();
if (jdbcDialect.dialectName().equals("PostgreSQL")) {
((PostgresqlColumnConverter) rowConverter).setConnection((BaseConnection) dbConn);
if (rowConverter instanceof JdbcColumnConverter) {
if (jdbcDialect.dialectName().equals("PostgresSQL")) {
((PostgresqlColumnConverter) rowConverter).setConnection((BaseConnection) dbConn);
}
((PostgresqlColumnConverter) rowConverter).setFieldTypeList(columnTypeList);
}
((PostgresqlColumnConverter) rowConverter).setFieldTypeList(columnTypeList);
} catch (SQLException sqe) {
throw new IllegalArgumentException("checkUpsert() failed.", sqe);
}
Expand Down

0 comments on commit 95bfcec

Please sign in to comment.