Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const readParquet = async (fileKey) => {
- const filePath = 'parquet-test-file.plain'; // 'snappy';
- console.log('----- reading file : ', filePath);
- let reader = await parquet.ParquetReader.openFile(filePath);
- console.log('---- ParquetReader initialized....');
- // create a new cursor
- let cursor = reader.getCursor();
- // read all records from the file and print them
- if (cursor) {
- console.log('---- cursor initialized....');
- let record = await cursor.next() ; // this line throws exception
- while (record) {
- console.log(record);
- record = await cursor.next();
- }
- }
- await reader.close();
- console.log('----- done with reading parquet file....');
- return;
- };
- let dt = readParquet(fileKeys.dataFileKey);
- dt
- .then((value) => console.log('--------SUCCESS', value))
- .catch((error) => {
- console.log('-------FAILURE ', error); // Random error
- console.log(error.stack);
- })
Add Comment
Please, Sign In to add comment