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

CLI: numeric filename converted to number, raises javascript TypeError #49

Open
pappasam opened this issue Oct 2, 2017 · 3 comments
Open
Labels

Comments

@pappasam
Copy link

pappasam commented Oct 2, 2017

First: thank you for building this super-useful tool. Definitely comes in handy when needing to run quick diffs against two parquet files.

Issue

Numeric filenames cause javascript errors. Since my parquet files are output by hive, they have numeric names.

Details

If you run the following code:

parquet head 00000

You'll get the following error message:

cat 0
/home/youruser/.nodenv/versions/6.11.2/lib/node_modules/node-parquet/bin/parquet.js:54
  const reader = new parquet.ParquetReader(file);
                 ^

TypeError: wrong argument
    at TypeError (native)
    at cat (/home/sroeca/.nodenv/versions/6.11.2/lib/node_modules/node-parquet/bin/parquet.js:54:18)
    at Object.<anonymous> (/home/sroeca/.nodenv/versions/6.11.2/lib/node_modules/node-parquet/bin/parquet.js:43:5)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.runMain (module.js:604:10)
    at run (bootstrap_node.js:389:7)

Workaround

At present, the simple workaround is to rename the files to a non-numeric value. This is mildly cumbersome.

@pappasam
Copy link
Author

pappasam commented Oct 2, 2017

bin/parquet.js will most-likely need some major refactoring. Shouldn't be too difficult to implement, but I'm not sure what you're planning for this module in the future.

@mvertes mvertes added the bug label Oct 4, 2017
@mvertes
Copy link
Collaborator

mvertes commented Oct 4, 2017

Thanks for your report. I fixed it in my branch, correction will be included in the next release.

Regarding plans for this module, I intend to improve it to the point where I can convert parquet files from/to JSON and CSV format. I would like also to have a working pure JS version, which will be embeddable in browser. I'm lacking time at this moment, but hope to improve it anyway

@mvertes mvertes closed this as completed in 2917219 Oct 4, 2017
mvertes added a commit that referenced this issue Oct 4, 2017
bin/parquet: fix handling of numeric filenames, fix #49
@mvertes mvertes reopened this Oct 5, 2017
@mvertes
Copy link
Collaborator

mvertes commented Oct 5, 2017

was unvoluntary closed. Sorry. The state is: corrected, waiting for validation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants