diff --git a/chunjun-connectors/chunjun-connector-jdbc-base/src/main/java/com/dtstack/chunjun/connector/jdbc/source/JdbcInputFormat.java b/chunjun-connectors/chunjun-connector-jdbc-base/src/main/java/com/dtstack/chunjun/connector/jdbc/source/JdbcInputFormat.java index 5cc76200da..a6c5842983 100644 --- a/chunjun-connectors/chunjun-connector-jdbc-base/src/main/java/com/dtstack/chunjun/connector/jdbc/source/JdbcInputFormat.java +++ b/chunjun-connectors/chunjun-connector-jdbc-base/src/main/java/com/dtstack/chunjun/connector/jdbc/source/JdbcInputFormat.java @@ -868,11 +868,12 @@ protected void executeQuery(String startLocation) throws SQLException { state = startLocation; } } else { - statement = dbConn.createStatement(resultSetType, resultSetConcurrency); - statement.setFetchSize(jdbcConf.getFetchSize()); - statement.setQueryTimeout(jdbcConf.getQueryTimeOut()); - resultSet = statement.executeQuery(jdbcConf.getQuerySql()); - hasNext = resultSet.next(); +// statement = dbConn.createStatement(resultSetType, resultSetConcurrency); +// statement.setFetchSize(jdbcConf.getFetchSize()); +// statement.setQueryTimeout(jdbcConf.getQueryTimeOut()); +// resultSet = statement.executeQuery(jdbcConf.getQuerySql()); +// hasNext = resultSet.next(); + throw new UnsupportedOperationException("must be polling"); } } diff --git a/chunjun-core/src/main/java/com/dtstack/chunjun/element/ColumnRowData.java b/chunjun-core/src/main/java/com/dtstack/chunjun/element/ColumnRowData.java index fbf243ae40..89ff10c5c2 100644 --- a/chunjun-core/src/main/java/com/dtstack/chunjun/element/ColumnRowData.java +++ b/chunjun-core/src/main/java/com/dtstack/chunjun/element/ColumnRowData.java @@ -240,8 +240,13 @@ public StringData getString(int pos) { @Override public DecimalData getDecimal(int pos, int precision, int scale) { - BigDecimal bigDecimal = this.columnList.get(pos).asBigDecimal(); - return DecimalData.fromBigDecimal(bigDecimal, bigDecimal.precision(), bigDecimal.scale()); + + // baisui modify 2022/07/29 + AbstractBaseColumn col = this.columnList.get(pos); + BigDecimal bigDecimal = (BigDecimal) col.getData(); + // =this.columnList.get(pos).asBigDecimal(); + // return DecimalData.fromBigDecimal(bigDecimal, bigDecimal.precision(), bigDecimal.scale()); + return DecimalData.fromBigDecimal(bigDecimal, precision, scale); } @Override diff --git a/chunjun-core/src/main/java/com/dtstack/chunjun/element/column/TimeColumn.java b/chunjun-core/src/main/java/com/dtstack/chunjun/element/column/TimeColumn.java index 2a18cc2ee9..ef000e8c6d 100644 --- a/chunjun-core/src/main/java/com/dtstack/chunjun/element/column/TimeColumn.java +++ b/chunjun-core/src/main/java/com/dtstack/chunjun/element/column/TimeColumn.java @@ -104,7 +104,13 @@ public String asTimestampStr() { @Override public Integer asInt() { - throw new CastException("java.sql.Time", "Integer", this.asString()); + // throw new CastException("java.sql.Time", "Integer", this.asString()); + + Time time = asTime(); + if (time == null) { + return null; + } + return (int) time.getTime(); } @Override