-
Notifications
You must be signed in to change notification settings - Fork 4k
Description
Describe the bug, including details regarding any error messages, version, and platform.
When input stream is empty, the reader throws exception when reading the schema, refer to
| int schemaMessageLength = await ReadMessageLengthAsync(throwOnFullRead: true, cancellationToken) |
System.InvalidOperationException
HResult=0x80131509
Message=Unexpectedly reached the end of the stream before a full buffer was read.
Source=Apache.Arrow
StackTrace:
at Apache.Arrow.Ipc.ArrowStreamReaderImplementation.EnsureFullRead(Memory`1 buffer, Int32 bytesRead) in /arrow/csharp/src/Apache.Arrow/Ipc/ArrowStreamReaderImplementation.cs:line 276
at Apache.Arrow.Ipc.ArrowStreamReaderImplementation.ReadMessageLength(Boolean throwOnFullRead) in /arrow/csharp/src/Apache.Arrow/Ipc/ArrowStreamReaderImplementation.cs:line 238
at Apache.Arrow.Ipc.ArrowStreamReaderImplementation.ReadSchema() in /arrow/csharp/src/Apache.Arrow/Ipc/ArrowStreamReaderImplementation.cs:line 179
at Apache.Arrow.Ipc.ArrowStreamReaderImplementation.ReadRecordBatch() in /arrow/csharp/src/Apache.Arrow/Ipc/ArrowStreamReaderImplementation.cs:line 106
at Apache.Arrow.Ipc.ArrowStreamReaderImplementation.ReadNextRecordBatch() in /arrow/csharp/src/Apache.Arrow/Ipc/ArrowStreamReaderImplementation.cs:line 53
at Apache.Arrow.Ipc.ArrowStreamReader.ReadNextRecordBatch() in /arrow/csharp/src/Apache.Arrow/Ipc/ArrowStreamReader.cs:line 107
...
On the other hand, javascript handles such input. And C++ lib also handles it, refer to https://github.com/apache/arrow/blob/cd607d00b9e3c5f2ac2a2e373ba7571fd75fc725/cpp/src/arrow/ipc/reader.cc#L1109C7-L1111C10. The behavior in javascript and C++ is that null RecordBatch is returned.
Component(s)
C#