Skip to content

fix: Add DateDayVector support #141

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Nov 26, 2023
Merged
Changes from 2 commits
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
10 changes: 10 additions & 0 deletions lib/src/main/java/io/cloudquery/helper/ArrowHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
import org.apache.arrow.memory.RootAllocator;
import org.apache.arrow.vector.BigIntVector;
import org.apache.arrow.vector.BitVector;
import org.apache.arrow.vector.DateDayVector;
import org.apache.arrow.vector.DateMilliVector;
import org.apache.arrow.vector.FieldVector;
import org.apache.arrow.vector.FixedSizeBinaryVector;
import org.apache.arrow.vector.Float4Vector;
Expand Down Expand Up @@ -139,6 +141,14 @@ private static void setVectorData(FieldVector vector, Object data) {
jsonVector.setSafe(0, (byte[]) data);
return;
}
if (vector instanceof DateDayVector dayDateVector) {
dayDateVector.set(0, (int) data);
return;
}
if (vector instanceof DateMilliVector dateMilliVector) {
dateMilliVector.set(0, (long) data);
return;
}

throw new IllegalArgumentException("Unsupported vector type: " + vector.getClass());
}
Expand Down