Skip to content

Commit

Permalink
Added missing JsonFile case.
Browse files Browse the repository at this point in the history
  • Loading branch information
CurtHagenlocher committed Oct 5, 2023
1 parent c6bae06 commit a68d38f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions csharp/test/Apache.Arrow.IntegrationTest/JsonFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ private static IArrowType ToArrowType(JsonArrowType type, Field[] children)
"fixedsizebinary" => new FixedSizeBinaryType(type.ByteWidth),
"date" => ToDateArrowType(type),
"time" => ToTimeArrowType(type),
"duration" => ToDurationArrowType(type),
"timestamp" => ToTimestampArrowType(type),
"list" => ToListArrowType(type, children),
"fixedsizelist" => ToFixedSizeListArrowType(type, children),
Expand Down Expand Up @@ -191,6 +192,18 @@ private static IArrowType ToTimeArrowType(JsonArrowType type)
};
}

private static IArrowType ToDurationArrowType(JsonArrowType type)
{
return type.Unit switch
{
"SECOND" => DurationType.Second,
"MILLISECOND" => DurationType.Millisecond,
"MICROSECOND" => DurationType.Microsecond,
"NANOSECOND" => DurationType.Nanosecond,
_ => throw new NotSupportedException($"Time type not supported: {type.Unit}, {type.BitWidth}")
};
}

private static IArrowType ToTimestampArrowType(JsonArrowType type)
{
return type.Unit switch
Expand Down

0 comments on commit a68d38f

Please sign in to comment.