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:
Koji Kawamura 2017-05-11 09:02:13 +09:00 committed by Matt Burgess
parent 6e4db6b11a
commit 0b0ac196ea
1 changed files with 1 additions and 1 deletions

View File

@ -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);
} }