domoritz commented on code in PR #13278:
URL: https://github.com/apache/arrow/pull/13278#discussion_r886310516


##########
js/test/unit/ipc/serialization-tests.ts:
##########
@@ -37,6 +37,30 @@ function createTable<T extends TypeMap = any>(schema: 
Schema<T>, chunkLengths: n
     return generate.table(chunkLengths, schema).table;
 }
 
+describe('tableFromIPC', () => {
+    test('handles AsyncRecordBatchReader input', async () => {
+        type T = { a: Uint8 };
+
+        const sources = [
+            new Table({ a: makeVector(new Uint8Array([1, 2, 3])) }),
+            new Table({ a: makeVector(new Uint8Array([4, 5, 6])) }),
+        ];
+
+        const writer = sources.reduce(
+            (writer, source) => writer.writeAll(source),
+            new RecordBatchStreamWriter<T>({ autoDestroy: false })
+        );
+
+        writer.close();
+
+        let index = 0;
+
+        for await (const reader of 
RecordBatchReader.readAll<T>(writer[Symbol.asyncIterator]())) {
+            expect(sources[index++]).toEqualTable(await tableFromIPC(reader));

Review Comment:
   Shouldn't this be the other way around (actual on the left)? 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to