ljluestc commented on issue #14256:
URL: https://github.com/apache/arrow/issues/14256#issuecomment-1661615437

   ```
   const fs = require("fs");
   const { tableFromChunks, RecordBatchStreamReader } = require("apache-arrow");
   
   const filePath = "./arraydata.arrow";
   const chunkSize = 100000; // Set an appropriate chunk size based on 
available memory
   
   const stream = fs.createReadStream(filePath);
   const reader = new RecordBatchStreamReader(stream);
   
   (async function () {
     let chunks = [];
     for await (const chunk of tableFromChunks(reader, chunkSize)) {
       chunks.push(chunk);
     }
   
     // Concatenate the chunks to form the complete table
     const table = chunks.reduce((acc, chunk) => acc.concat(chunk));
   
     console.log("numRows", table.numRows);
     console.log("first row", table.get(0).toArray());
   })();
   
   ```


-- 
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