Skip to content

Commit

Permalink
Fix ArrayIndexOutOfBoundsException when parsing Hive timestamp column
Browse files Browse the repository at this point in the history
  • Loading branch information
viirya authored and martint committed Dec 2, 2014
1 parent d8f7441 commit 86a21b2
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -399,7 +399,7 @@ else if (hiveTypes[column].equals(HIVE_DATE)) {
else if (hiveTypes[column].equals(HIVE_TIMESTAMP)) {
checkState(length >= 1, "Timestamp should be at least 1 byte");
long seconds = TimestampWritable.getSeconds(bytes, start);
long nanos = TimestampWritable.getNanos(bytes, start + SIZE_OF_INT);
long nanos = (bytes[start] >> 7) != 0 ? TimestampWritable.getNanos(bytes, start + SIZE_OF_INT) : 0;
longs[column] = (seconds * 1000) + (nanos / 1_000_000);
}
else if (hiveTypes[column].equals(HIVE_BYTE)) {
Expand Down

0 comments on commit 86a21b2

Please sign in to comment.