Skip to content

Commit

Permalink
ARROW-13689: [C#][Integration] Initial commit of C# Integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
eerhardt committed Sep 28, 2021
1 parent 64e683b commit 052e774
Show file tree
Hide file tree
Showing 10 changed files with 771 additions and 4 deletions.
11 changes: 11 additions & 0 deletions csharp/Apache.Arrow.sln
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Apache.Arrow.Flight", "src\
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Apache.Arrow.Flight.AspNetCore", "src\Apache.Arrow.Flight.AspNetCore\Apache.Arrow.Flight.AspNetCore.csproj", "{E4F74938-E8FF-4AC1-A495-FEE95FC1EFDF}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{1D1EF692-F180-40D2-AAD3-315EF1A4D1B9}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Apache.Arrow.IntegrationTest", "test\Apache.Arrow.IntegrationTest\Apache.Arrow.IntegrationTest.csproj", "{E8264B7F-B680-4A55-939B-85DB628164BB}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -51,11 +55,18 @@ Global
{E4F74938-E8FF-4AC1-A495-FEE95FC1EFDF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E4F74938-E8FF-4AC1-A495-FEE95FC1EFDF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E4F74938-E8FF-4AC1-A495-FEE95FC1EFDF}.Release|Any CPU.Build.0 = Release|Any CPU
{E8264B7F-B680-4A55-939B-85DB628164BB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E8264B7F-B680-4A55-939B-85DB628164BB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E8264B7F-B680-4A55-939B-85DB628164BB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E8264B7F-B680-4A55-939B-85DB628164BB}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {FD0BB617-6031-4844-B99D-B331E335B572}
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{E8264B7F-B680-4A55-939B-85DB628164BB} = {1D1EF692-F180-40D2-AAD3-315EF1A4D1B9}
EndGlobalSection
EndGlobal
8 changes: 8 additions & 0 deletions csharp/src/Apache.Arrow/Ipc/ArrowStreamWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using Apache.Arrow.Arrays;
using Apache.Arrow.Types;
using FlatBuffers;

Expand All @@ -46,6 +47,7 @@ internal class ArrowRecordBatchFlatBufferBuilder :
IArrowArrayVisitor<ListArray>,
IArrowArrayVisitor<StringArray>,
IArrowArrayVisitor<BinaryArray>,
IArrowArrayVisitor<FixedSizeBinaryArray>,
IArrowArrayVisitor<StructArray>,
IArrowArrayVisitor<Decimal128Array>,
IArrowArrayVisitor<Decimal256Array>,
Expand Down Expand Up @@ -107,6 +109,12 @@ public void Visit(BinaryArray array)
_buffers.Add(CreateBuffer(array.ValueBuffer));
}

public void Visit(FixedSizeBinaryArray array)
{
_buffers.Add(CreateBuffer(array.NullBitmapBuffer));
_buffers.Add(CreateBuffer(array.ValueBuffer));
}

public void Visit(Decimal128Array array)
{
_buffers.Add(CreateBuffer(array.NullBitmapBuffer));
Expand Down
11 changes: 10 additions & 1 deletion csharp/src/Apache.Arrow/Ipc/ArrowTypeFlatbufferBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ class TypeVisitor :
IArrowTypeVisitor<StructType>,
IArrowTypeVisitor<Decimal128Type>,
IArrowTypeVisitor<Decimal256Type>,
IArrowTypeVisitor<DictionaryType>
IArrowTypeVisitor<DictionaryType>,
IArrowTypeVisitor<FixedSizeBinaryType>
{
private FlatBufferBuilder Builder { get; }

Expand Down Expand Up @@ -209,6 +210,14 @@ public void Visit(DictionaryType type)
// type in the DictionaryEncoding metadata in the parent field
type.ValueType.Accept(this);
}

public void Visit(FixedSizeBinaryType type)
{
Flatbuf.FixedSizeBinary.StartFixedSizeBinary(Builder);
Result = FieldType.Build(
Flatbuf.Type.FixedSizeBinary,
Flatbuf.FixedSizeBinary.EndFixedSizeBinary(Builder));
}

public void Visit(IArrowType type)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="System.CommandLine" Version="2.0.0-beta1.21216.1" />
<PackageReference Include="System.Text.Json" Version="5.0.2" />
<ProjectReference Include="..\..\src\Apache.Arrow\Apache.Arrow.csproj" />
</ItemGroup>

</Project>
Loading

0 comments on commit 052e774

Please sign in to comment.