Skip to content

Commit

Permalink
Merge pull request #4 from cdoron/TimeStampMicroVector
Browse files Browse the repository at this point in the history
add support for TimeStampMicroVector in FlightArrowColumnVector.java
  • Loading branch information
Ryan Murray authored Jan 20, 2021
2 parents a0a20b3 + edd027e commit bd5d51c
Showing 1 changed file with 21 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import org.apache.arrow.vector.Float8Vector;
import org.apache.arrow.vector.IntVector;
import org.apache.arrow.vector.SmallIntVector;
import org.apache.arrow.vector.TimeStampMicroVector;
import org.apache.arrow.vector.TimeStampMicroTZVector;
import org.apache.arrow.vector.TimeStampMilliVector;
import org.apache.arrow.vector.TimeStampVector;
Expand Down Expand Up @@ -200,8 +201,10 @@ public FlightArrowColumnVector(ValueVector vector) {
accessor = new DateAccessor((DateDayVector) vector);
} else if (vector instanceof DateMilliVector) {
accessor = new DateMilliAccessor((DateMilliVector) vector);
} else if (vector instanceof TimeStampMicroVector) {
accessor = new TimestampMicroAccessor((TimeStampMicroVector) vector);
} else if (vector instanceof TimeStampMicroTZVector) {
accessor = new TimestampAccessor((TimeStampMicroTZVector) vector);
accessor = new TimestampMicroTZAccessor((TimeStampMicroTZVector) vector);
} else if (vector instanceof TimeStampMilliVector) {
accessor = new TimestampMilliAccessor((TimeStampMilliVector) vector);
} else if (vector instanceof ListVector) {
Expand Down Expand Up @@ -480,11 +483,26 @@ final int getInt(int rowId) {
}
}

private static class TimestampAccessor extends ArrowVectorAccessor {
private static class TimestampMicroAccessor extends ArrowVectorAccessor {

private final TimeStampVector accessor;

TimestampAccessor(TimeStampMicroTZVector vector) {
TimestampMicroAccessor(TimeStampMicroVector vector) {
super(vector);
this.accessor = vector;
}

@Override
final long getLong(int rowId) {
return accessor.get(rowId);
}
}

private static class TimestampMicroTZAccessor extends ArrowVectorAccessor {

private final TimeStampVector accessor;

TimestampMicroTZAccessor(TimeStampMicroTZVector vector) {
super(vector);
this.accessor = vector;
}
Expand Down

0 comments on commit bd5d51c

Please sign in to comment.