Skip to content

Commit

Permalink
DX-100503: missed classes
Browse files Browse the repository at this point in the history
  • Loading branch information
xxlaykxx committed Feb 13, 2025
1 parent e87f922 commit 02bd636
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,12 @@ public List<ArrowBuf> visit(ArrowType.Timestamp type) {
maybeImportBitmap(type), importFixedBytes(type, 1, TimeStampVector.TYPE_WIDTH));
}

@Override
public List<ArrowBuf> visit(ArrowType.TimestampWithPrecision type) {
return Arrays.asList(
maybeImportBitmap(type), importFixedBytes(type, 1, TimeStampVector.TYPE_WIDTH));
}

@Override
public List<ArrowBuf> visit(ArrowType.Interval type) {
switch (type.getUnit()) {
Expand Down
9 changes: 9 additions & 0 deletions java/c/src/main/java/org/apache/arrow/c/Format.java
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,12 @@ static String asString(ArrowType arrowType) {
String timezone = type.getTimezone();
return String.format("%s:%s", format, timezone == null ? "" : timezone);
}
case TimestampWithPrecision:
{
ArrowType.TimestampWithPrecision type = (ArrowType.TimestampWithPrecision) arrowType;
String timezone = type.getTimezone();
return String.format("tsp:%s,%d", timezone == null ? "" : timezone, type.getPrecision());
}
case Union:
ArrowType.Union type = (ArrowType.Union) arrowType;
String typeIDs =
Expand Down Expand Up @@ -360,6 +366,9 @@ private static ArrowType parseComplexFormat(String format, String payload)
return new ArrowType.Timestamp(TimeUnit.MICROSECOND, payloadToTimezone(payload));
case "tsn":
return new ArrowType.Timestamp(TimeUnit.NANOSECOND, payloadToTimezone(payload));
case "tsp":
String[] parts = payload.split(",");
return new ArrowType.TimestampWithPrecision(Integer.parseInt(parts[1]), parts[0]);
default:
throw new UnsupportedOperationException(
String.format("Format %s:%s is not supported", format, payload));
Expand Down

0 comments on commit 02bd636

Please sign in to comment.