DBZ-5946 Print the readable data class name in JdbcValueConverters.handleUnknownData
This commit is contained in:
parent
bae49fec2a
commit
348e77d334
@ -1276,17 +1276,18 @@ else if (data instanceof Long) {
|
|||||||
* @throws IllegalArgumentException if the value could not be converted but the column does not allow nulls
|
* @throws IllegalArgumentException if the value could not be converted but the column does not allow nulls
|
||||||
*/
|
*/
|
||||||
protected Object handleUnknownData(Column column, Field fieldDefn, Object data) {
|
protected Object handleUnknownData(Column column, Field fieldDefn, Object data) {
|
||||||
if (column.isOptional() || fieldDefn.schema().isOptional()) {
|
|
||||||
Class<?> dataClass = data.getClass();
|
Class<?> dataClass = data.getClass();
|
||||||
|
String clazzName = dataClass.isArray() ? dataClass.getSimpleName() : dataClass.getName();
|
||||||
|
if (column.isOptional() || fieldDefn.schema().isOptional()) {
|
||||||
|
|
||||||
if (logger.isWarnEnabled()) {
|
if (logger.isWarnEnabled()) {
|
||||||
logger.warn("Unexpected value for JDBC type {} and column {}: class={}", column.jdbcType(), column,
|
logger.warn("Unexpected value for JDBC type {} and column {}: class={}", column.jdbcType(), column,
|
||||||
dataClass.isArray() ? dataClass.getSimpleName() : dataClass.getName()); // don't include value in case its
|
clazzName); // don't include value in case its sensitive
|
||||||
// sensitive
|
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
throw new IllegalArgumentException("Unexpected value for JDBC type " + column.jdbcType() + " and column " + column +
|
throw new IllegalArgumentException("Unexpected value for JDBC type " + column.jdbcType() + " and column " + column +
|
||||||
": class=" + data.getClass()); // don't include value in case its sensitive
|
": class=" + clazzName); // don't include value in case its sensitive
|
||||||
}
|
}
|
||||||
|
|
||||||
protected int getTimePrecision(Column column) {
|
protected int getTimePrecision(Column column) {
|
||||||
|
Loading…
Reference in New Issue
Block a user