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

Cannot write a parquet file having a comma in one of its headers #117

Open
bartero opened this issue Oct 9, 2020 · 1 comment
Open

Cannot write a parquet file having a comma in one of its headers #117

bartero opened this issue Oct 9, 2020 · 1 comment

Comments

@bartero
Copy link

bartero commented Oct 9, 2020

I came across a very unfortunate problem using this library.
Whenever I try to read a parquet file created with this same tool and containing a comma , in any of its headers.
I get this error while await parquetReader.getCursor().next(): TypeError: Cannot read property 'fields' of undefined
stacktrace:

at ParquetSchema.findField (../../.yarn/cache/parquetjs-npm-0.11.2-9df3a54481-63137e17bc.zip/node_modules/parquetjs/lib/schema.js:35:22)
      at Object.exports.materializeRecords (../../.yarn/cache/parquetjs-npm-0.11.2-9df3a54481-63137e17bc.zip/node_modules/parquetjs/lib/shred.js:164:26)
      at ParquetCursor.next (../../.yarn/cache/parquetjs-npm-0.11.2-9df3a54481-63137e17bc.zip/node_modules/parquetjs/lib/reader.js:62:40)

I guess this is caused by a rather "unsafe" operation in the parquetjs/lib/schema.js file on line 28: path.split(",")

I would be very helpful for any help with this problem.
Thank you!

@bartero
Copy link
Author

bartero commented Oct 14, 2020

Hi!
I have written a solution for it! Look below :-)

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