skale-me / node-parquet

NodeJS module to access apache parquet format files
Apache License 2.0
57 stars 11 forks source link

cannot write more then once #59

Open thomascool opened 5 years ago

thomascool commented 5 years ago

based on the example on the readme:

var parquet = require('node-parquet');

var schema = { small_int: {type: 'int32', optional: true}, big_int: {type: 'int64'}, my_boolean: {type: 'bool'}, name: {type: 'byte_array', optional: true}, };

var data = [ [ 1, 23234, true, 'hello world'], [ , 1234, false, ], ];

var writer = new parquet.ParquetWriter('my_file.parquet', schema); writer.write(data); writer.close();

Here will be the output:

$ ./node_modules/node-parquet/bin/parquet.js cat ./my_file.parquet [1,23234,true,"hello world"] [null,1234,false,null]

If write it three times like below: writer.write(data); writer.write(data); writer.write(data); writer.close();

The output will be nulls after first write: $ ./node_modules/node-parquet/bin/parquet.js cat ./my_file.parquet [1,23234,true,"hello world"] [null,1234,false,null] [null,null,null,null] [null,null,null,null] [null,null,null,null] [null,null,null,null]

dogenius01 commented 5 years ago

Same issue.