mirror of https://github.com/apache/nifi.git
NIFI-3861: AvroTypeUtil used different constant.
Previous fix #1779 refactored the way to check Logical type to use string constants. One of those refactoring used wrong constant mistakenly in normalizeValue method. Fortunately, this defect is harmless since even though normalizeValue did not convert int to Time, DataTypeUtils.convertType does the same conversion. Signed-off-by: Matt Burgess <mattyb149@apache.org> This closes #1782
This commit is contained in:
parent
6e4db6b11a
commit
0b0ac196ea
|
@ -481,7 +481,7 @@ public class AvroTypeUtil {
|
||||||
if (LOGICAL_TYPE_DATE.equals(logicalName)) {
|
if (LOGICAL_TYPE_DATE.equals(logicalName)) {
|
||||||
// date logical name means that the value is number of days since Jan 1, 1970
|
// date logical name means that the value is number of days since Jan 1, 1970
|
||||||
return new java.sql.Date(TimeUnit.DAYS.toMillis((int) value));
|
return new java.sql.Date(TimeUnit.DAYS.toMillis((int) value));
|
||||||
} else if (LOGICAL_TYPE_TIMESTAMP_MILLIS.equals(logicalName)) {
|
} else if (LOGICAL_TYPE_TIME_MILLIS.equals(logicalName)) {
|
||||||
// time-millis logical name means that the value is number of milliseconds since midnight.
|
// time-millis logical name means that the value is number of milliseconds since midnight.
|
||||||
return new java.sql.Time((int) value);
|
return new java.sql.Time((int) value);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue