[英]NodeJS (JavaScript/TypeScript) - Error while reading Parquet file
I am trying to read parquet file with nodejs:我正在尝试使用 nodejs 读取镶木地板文件:
var parquet = require('parquetjs');
(
async () => {
try {
// create new ParquetReader that reads from 'fruits.parquet`
let reader = await parquet.ParquetReader.openFile('f1.snappy.parquet');
// create a new cursor
let cursor = reader.getCursor();
// read all records from the file and print them
let record = null;
while (record = await cursor.next()) {
console.log(record);
}
} catch (e) {
console.log('error while reading a parquet file:\n', e)
}
}
) ();
Getting error:获取错误:
error while reading a parquet file:
invalid page type: DICTIONARY_PAGE
Same parquet file - I can read with Python pyarrow library without issue..相同的镶木地板文件 - 我可以使用 Python pyarrow 库毫无问题地阅读..
What can be the reason?原因是什么?
I was having this same issue (and some others when reading nested objects) with parquetjs我在使用 parquetjs 时遇到了同样的问题(在阅读嵌套对象时还有其他一些问题)
I switched to https://www.npmjs.com/package/parquetjs-lite and now everything works smoothly我切换到https://www.npmjs.com/package/parquetjs-lite现在一切正常
parquetjs-lite is a fork of parquetjs so I didn't need to change any of my code parquetjs-lite 是 parquetjs 的一个分支,所以我不需要更改任何代码
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.