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

未关闭
#87 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
领域
data

调研方向

从 JavaScript SDK 入口 RecordBatchReader.from、tableFromIPC 和 table.get(0).toArray() 开始,使用提供的 Python 生成器和大文件读取器示例来复现该失败。完成标准是:超过 2GB 的 Arrow 文件仍能报告正确的行数,并返回其值而不是 undefined。

由索引模型根据 Issue 内容生成。

描述

Type: bug

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.

主要语言
TypeScript
星标
114
派生
35
平均合并
13 小时 35 分钟
30 天内合并 PR
5

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

apache/arrow-js 的其他 Issue

查看 apache/arrow-js 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。