Skip to content
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

cursor.buffer.readInt32LE is not a function #71

Open
Rodriguevb opened this issue May 4, 2021 · 0 comments
Open

cursor.buffer.readInt32LE is not a function #71

Rodriguevb opened this issue May 4, 2021 · 0 comments

Comments

@Rodriguevb
Copy link

I use NuxtJS and I would like to read a parquet file from a URL. I get an error when I read the records using the cursor.next() method. The file seems to be of the right format because I can download it via the url and read it via this website: https://parquet-viewer-online.com

I forgot a dependency?

async readParquetFile(url) {
	const parquet = require('parquetjs-lite');
	const request = require('request');
	let reader = await parquet.ParquetReader.openUrl(request, url)
	let cursor = reader.getCursor();
	let record = null;
	while (record = await cursor.next()) {   // error TypeError: cursor.buffer.readInt32LE is not a function
		console.log(record);
	}
}
TypeError: cursor.buffer.readInt32LE is not a function
    at decodeValues_INT32 (plain.js?8f9a:42)
    at Object.exports.decodeValues (plain.js?8f9a:251)
    at decodeValues (reader.js?245a:614)
    at decodeDataPage (reader.js?245a:832)
    at decodePage (reader.js?245a:670)
    at decodePages (reader.js?245a:713)
    at eval (reader.js?245a:577)
    at async ParquetEnvelopeReader.readRowGroup (reader.js?245a:535)
    at async ParquetCursor.next (reader.js?245a:60)

I use NuxtJs with these dependencies in package.json

"dependencies": {
	"@nuxtjs/axios": "latest",
	"@nuxtjs/pwa": "latest",
	"fs": "latest",
	"net": "latest",
	"tls": "latest",
	"nuxt": "latest",
	"parquetjs-lite": "latest",
	"request": "latest"
},

and with this build in nuxt.config.js

build: {
	extend(config, {}) {
		config.node = {
			fs: 'empty',
		}
	}
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant