diff --git a/csharp/src/Apache.Arrow.Flight.Sql/ChannelReaderStreamAdapter.cs b/csharp/src/Apache.Arrow.Flight.Sql/ChannelReaderStreamAdapter.cs deleted file mode 100644 index 14cf03ca40771..0000000000000 --- a/csharp/src/Apache.Arrow.Flight.Sql/ChannelReaderStreamAdapter.cs +++ /dev/null @@ -1,54 +0,0 @@ -// Licensed to the Apache Software Foundation (ASF) under one or more -// contributor license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright ownership. -// The ASF licenses this file to You under the Apache License, Version 2.0 -// (the "License"); you may not use this file except in compliance with -// the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -using System; -using System.Threading; -using System.Threading.Channels; -using System.Threading.Tasks; -using Grpc.Core; - -namespace Apache.Arrow.Flight.Sql; - -internal class ChannelReaderStreamAdapter : IAsyncStreamReader -{ - private readonly ChannelReader _channelReader; - - public ChannelReaderStreamAdapter(ChannelReader channelReader) - { - _channelReader = channelReader ?? throw new ArgumentNullException(nameof(channelReader)); - Current = default!; - } - - public T Current { get; private set; } - - public async Task MoveNext(CancellationToken cancellationToken) - { - if (await _channelReader.WaitToReadAsync(cancellationToken).ConfigureAwait(false)) - { - if (_channelReader.TryRead(out var item)) - { - Current = item; - return true; - } - } - - return false; - } - - public void Dispose() - { - // No additional cleanup is required here since we are using a channel - } -} \ No newline at end of file diff --git a/csharp/src/Apache.Arrow.Flight.Sql/PreparedStatement.cs b/csharp/src/Apache.Arrow.Flight.Sql/PreparedStatement.cs index 4d2c304a31688..0399e1636762a 100644 --- a/csharp/src/Apache.Arrow.Flight.Sql/PreparedStatement.cs +++ b/csharp/src/Apache.Arrow.Flight.Sql/PreparedStatement.cs @@ -15,19 +15,14 @@ using System; using System.Collections.Generic; -using System.IO; using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; -using Apache.Arrow.Flight.Server; using Apache.Arrow.Flight.Sql.Client; -using Apache.Arrow.Ipc; using Arrow.Flight.Protocol.Sql; using Google.Protobuf; using Grpc.Core; -using System.Threading.Channels; -using Google.Protobuf.WellKnownTypes; namespace Apache.Arrow.Flight.Sql;