Skip to content

[JS] Values returned as undefined when arrow file bigger than 2gb #87

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
asfimport opened this issue Oct 12, 2022 · 0 comments
Open
Labels
Type: bug Something isn't working

Comments

@asfimport
Copy link

Steps:

 

  1. Generate arrow file bigger than 2gb
import pyarrow as pa

nums1 = [42]
nums2 = [42.42]
mil = 1000000

for n in range(1, 140 * mil):
  nums1.append(n)
  nums2.append(1 / n)

arr1 = pa.array(nums1)
arr2 = pa.array(nums2)

schema = pa.schema([
  pa.field('nums1', arr1.type),
  pa.field('nums2', arr2.type),
])

with pa.OSFile('arraydata.arrow', 'wb') as sink:
  with pa.ipc.new_file(sink, schema=schema) as writer:
    batch = pa.record_batch([arr1, arr2], schema=schema)
    writer.write(batch) 
  1. Try to read it via the JS SDK
const fs = require("fs");
const { tableFromIPC, RecordBatchReader } = require("apache-arrow");

const filePath = "./arraydata.arrow";

const stream = fs.createReadStream(filePath);
const reader = RecordBatchReader.from(stream);

(async function () {
  const table = await tableFromIPC(reader);

  console.log("numRows", table.numRows);
  console.log("first row", table.get(0).toArray());
})(); 

The code above prints:

numRows 140000000
first row [ undefined, undefined ] 

numRows is correct, but the values are coming out as {}undefined{}.

Reporter: Denis Gursky

Note: This issue was originally created as ARROW-18007. Please see the migration documentation for further details.

@assignUser assignUser transferred this issue from apache/arrow May 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant