Skip to content

Commit 0a3f410

Browse files
committed
fix(adapter): support conversion from Number to TIMESTAMPTZ in AbstractTypeAdapter
1 parent 8964a8d commit 0a3f410

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

core/src/main/java/kafka/automq/table/binder/AbstractTypeAdapter.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,9 @@ protected Object convertTimestamp(Object sourceValue, S sourceSchema, Types.Time
206206
Instant instant = Instant.parse(sourceValue.toString());
207207
return DateTimeUtil.timestamptzFromMicros(DateTimeUtil.microsFromInstant(instant));
208208
}
209+
if (sourceValue instanceof Number) {
210+
return DateTimeUtil.timestamptzFromMicros(((Number) sourceValue).longValue());
211+
}
209212
throw new IllegalArgumentException("Cannot convert " + sourceValue.getClass().getSimpleName() + " to " + targetType.typeId());
210213
}
211214

0 commit comments

Comments
 (0)