Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Support TimeType as Literal
  • Loading branch information
MaxGekk committed Sep 3, 2019
commit 51d48d5d67cc00c092f640301f2e476c1bf55016
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ public static Object read(
if (handleUserDefinedType && dataType instanceof UserDefinedType) {
return obj.get(ordinal, ((UserDefinedType)dataType).sqlType());
}
if (dataType instanceof TimeType) {
return obj.getLong(ordinal);
}

throw new UnsupportedOperationException("Unsupported data type " + dataType.simpleString());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ object InterpretedUnsafeProjection {
case IntegerType | DateType =>
(v, i) => writer.write(i, v.getInt(i))

case LongType | TimestampType =>
case LongType | TimestampType | TimeType =>
(v, i) => writer.write(i, v.getLong(i))

case FloatType =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ object Literal {
case ByteType => v.isInstanceOf[Byte]
case ShortType => v.isInstanceOf[Short]
case IntegerType | DateType => v.isInstanceOf[Int]
case LongType | TimestampType => v.isInstanceOf[Long]
case LongType | TimestampType | TimeType => v.isInstanceOf[Long]
case FloatType => v.isInstanceOf[Float]
case DoubleType => v.isInstanceOf[Double]
case _: DecimalType => v.isInstanceOf[Decimal]
Expand Down