Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion src/Apache.Arrow/Arrays/LargeStringArray.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ IEnumerator<string> IEnumerable<string>.GetEnumerator()
for (int index = 0; index < Length; index++)
{
yield return GetString(index);
};
}
}

IEnumerator IEnumerable.GetEnumerator() => ((IEnumerable<string>)this).GetEnumerator();
Expand Down
2 changes: 1 addition & 1 deletion src/Apache.Arrow/Arrays/StringArray.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ IEnumerator<string> IEnumerable<string>.GetEnumerator()
for (int index = 0; index < Length; index++)
{
yield return GetString(index);
};
}
}

IEnumerator IEnumerable.GetEnumerator() => ((IEnumerable<string>)this).GetEnumerator();
Expand Down
2 changes: 1 addition & 1 deletion src/Apache.Arrow/Arrays/StringViewArray.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ IEnumerator<string> IEnumerable<string>.GetEnumerator()
for (int index = 0; index < Length; index++)
{
yield return GetString(index);
};
}
}

IEnumerator IEnumerable.GetEnumerator() => ((IEnumerable<string>)this).GetEnumerator();
Expand Down
2 changes: 1 addition & 1 deletion src/Apache.Arrow/Arrays/TimestampArray.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public DateTimeOffset GetTimestampUnchecked(int index)
for (int index = 0; index < Length; index++)
{
yield return GetTimestamp(index);
};
}
}

int ICollection<DateTimeOffset?>.Count => Length;
Expand Down
2 changes: 1 addition & 1 deletion src/Apache.Arrow/C/CArrowSchemaExporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ private static long GetFlags(IArrowType datatype, bool nullable = true)
if (numFields == 0)
{
throw new NotSupportedException("Exporting nested data types with zero children.");
};
}

var pointerList = (CArrowSchema**)Marshal.AllocHGlobal(numFields * IntPtr.Size);

Expand Down
2 changes: 1 addition & 1 deletion src/Apache.Arrow/Ipc/ArrowStreamReaderImplementation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ private async ValueTask<int> ReadMessageLengthAsync(bool throwOnFullRead, bool r

messageLength = BitUtility.ReadInt32(lengthBuffer);
}
};
}

return messageLength;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="System.CommandLine" Version="2.0.0-beta4.22272.1" />
<PackageReference Include="System.CommandLine" Version="2.0.0-rc.1.25451.107" />
<PackageReference Include="System.Text.Json" Version="8.0.5" />
<ProjectReference Include="..\..\src\Apache.Arrow.Flight\Apache.Arrow.Flight.csproj" />
<ProjectReference Include="..\Apache.Arrow.Flight.TestWeb\Apache.Arrow.Flight.TestWeb.csproj" />
Expand Down
64 changes: 41 additions & 23 deletions test/Apache.Arrow.Flight.IntegrationTest/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.

using System;
using System.CommandLine;
using System.CommandLine.Parsing;
using System.IO;
using System.Threading.Tasks;

Expand All @@ -23,45 +25,61 @@ public static class Program
{
public static async Task<int> Main(string[] args)
{
var portOption = new Option<int>(
new[] { "--port", "-p" },
description: "Port the Flight server is listening on");
var scenarioOption = new Option<string>(
new[] { "--scenario", "-s" },
"The name of the scenario to run");
var pathOption = new Option<FileInfo>(
new[] { "--path", "-j" },
"Path to a JSON file of test data");

var rootCommand = new RootCommand(
"Integration test application for Apache.Arrow .NET Flight.");
var portOption = new Option<int>("--port", "-p")
{
Description = "Port the Flight server is listening on",
};
var scenarioOption = new Option<string>("--scenario", "-s")
{
Description = "The name of the scenario to run",
};
var pathOption = new Option<FileInfo>("--path", "-j")
{
Description = "Path to a JSON file of test data",
};

var clientCommand = new Command("client", "Run the Flight client")
{
portOption,
scenarioOption,
pathOption,
};
rootCommand.AddCommand(clientCommand);

clientCommand.SetHandler(async (port, scenario, jsonFile) =>
clientCommand.SetAction(async (parseResult, cancellationToken) =>
{
var command = new FlightClientCommand(port, scenario, jsonFile);
var command = new FlightClientCommand(
parseResult.GetValue(portOption),
parseResult.GetValue(scenarioOption),
parseResult.GetValue(pathOption));
await command.Execute().ConfigureAwait(false);
}, portOption, scenarioOption, pathOption);
});

var serverCommand = new Command("server", "Run the Flight server")
{
scenarioOption,
};
rootCommand.AddCommand(serverCommand);

serverCommand.SetHandler(async scenario =>
serverCommand.SetAction(async (parseResult, cancellationToken) =>
{
var command = new FlightServerCommand(scenario);
var command = new FlightServerCommand(
parseResult.GetValue(scenarioOption));
await command.Execute().ConfigureAwait(false);
}, scenarioOption);
});

var rootCommand = new RootCommand("Integration test application for Apache.Arrow .NET Flight.")
{
clientCommand,
serverCommand,
};

return await rootCommand.InvokeAsync(args).ConfigureAwait(false);
ParseResult parseResult = rootCommand.Parse(args);
if (parseResult.Errors.Count == 0)
{
return await parseResult.InvokeAsync();
}

foreach (ParseError parseError in parseResult.Errors)
{
Console.Error.WriteLine(parseError.Message);
}
return 1;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="System.CommandLine" Version="2.0.0-beta1.21216.1" />
<PackageReference Include="System.CommandLine" Version="2.0.0-rc.1.25451.107" />
<PackageReference Include="System.Text.Json" Version="8.0.5" />
<ProjectReference Include="..\..\src\Apache.Arrow.Compression\Apache.Arrow.Compression.csproj" />
<ProjectReference Include="..\..\src\Apache.Arrow\Apache.Arrow.csproj" />
Expand Down
49 changes: 29 additions & 20 deletions test/Apache.Arrow.IntegrationTest/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,41 +14,50 @@
// limitations under the License.

using System;
using System.Collections.Generic;
using System.CommandLine;
using System.CommandLine.Invocation;
using System.CommandLine.Parsing;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using Apache.Arrow.Types;

namespace Apache.Arrow.IntegrationTest
{
public class Program
{
public static async Task<int> Main(string[] args)
{
var integrationTestCommand = new RootCommand
var modeOption = new Option<string>("--mode")
{
new Option<string>(
"--mode",
description: "Which command to run"),
new Option<FileInfo>(
new[] { "--json-file", "-j" },
"The JSON file to interact with"),
new Option<FileInfo>(
new[] { "--arrow-file", "-a" },
"The arrow file to interact with")
Description = "Which command to run",
};
var jsonFileOption = new Option<FileInfo>("--json-file", "-j")
{
Description = "The JSON file to interact with",
};
var arrowFileOption = new Option<FileInfo>("--arrow-file", "-a")
{
Description = "The arrow file to interact with",
};

integrationTestCommand.Description = "Integration test app for Apache.Arrow .NET Library.";
var integrationTestCommand = new RootCommand("Integration test app for Apache.Arrow .NET Library.")
{
modeOption, jsonFileOption, arrowFileOption
};

ParseResult parseResult = integrationTestCommand.Parse(args);
if (parseResult.Errors.Count == 0)
{
var integrationCommand = new IntegrationCommand(
parseResult.GetValue(modeOption),
parseResult.GetValue(jsonFileOption),
parseResult.GetValue(arrowFileOption));
return await integrationCommand.Execute();
}

integrationTestCommand.Handler = CommandHandler.Create<string, FileInfo, FileInfo>(async (mode, j, a) =>
foreach (ParseError parseError in parseResult.Errors)
{
var integrationCommand = new IntegrationCommand(mode, j, a);
await integrationCommand.Execute();
});
return await integrationTestCommand.InvokeAsync(args);
Console.Error.WriteLine(parseError.Message);
}
return 1;
}
}
}
Loading