I’m using parquetjs and verifying the output using parquet-tools version 1.9.0. I’m writing just three small rows of data just to test.
test program:
"use strict";
var parquet = require('./parquet')
var schema = new parquet.ParquetSchema({
name: { type: 'UTF8', compression: 'SNAPPY' },
quantity: { type: 'INT64', compression: 'SNAPPY' },
price: { type: 'DOUBLE', compression: 'SNAPPY', optional: true },
date: { type: 'TIMESTAMP_MILLIS', compression: 'SNAPPY' },
in_stock: { type: 'BOOLEAN', compression: 'SNAPPY' }
})
var x = async function() {
var writer = await parquet.ParquetWriter.openFile(schema, 'fruits.parquet',{
compression: 'SNAPPY'
})
await writer.appendRow({name: 'apples', quantity: 10, price: 2.5, date: new Date(), in_stock: true})
await writer.appendRow({name: 'oranges', quantity: 10, price: 2.5, date: new Date(), in_stock: true})
await writer.appendRow({name: 'pears', quantity: 10, date: new Date(), in_stock: true})
writer.close()
}
x()
Here is the output of parquet-tools:
row group 0
name: BINARY SNAPPY DO:0 FPO:4 SZ:90/90/1.00 VC:3 ENC:PLAIN,RLE
quantity: INT64 SNAPPY DO:0 FPO:156 SZ:77/77/1.00 VC:3 ENC:PLAIN,RLE
price: DOUBLE SNAPPY DO:0 FPO:310 SZ:88/88/1.00 VC:3 ENC:PLAIN,RLE
date: INT64 SNAPPY DO:0 FPO:472 SZ:94/94/1.00 VC:3 ENC:PLAIN,RLE
in_stock: BOOLEAN SNAPPY DO:0 FPO:639 SZ:43/43/1.00 VC:3 ENC:PLAIN,RLE
name TV=3 RL=0 DL=0
----------------------------------------------------------------------------
page 0: DLE:RLE RLE:RLE VLE:PLAIN ST:[no stats for this column] SZ:30 VC:3
quantity TV=3 RL=0 DL=0
----------------------------------------------------------------------------
page 0: DLE:RLE RLE:RLE VLE:PLAIN ST:[min: 10, max: 10, num_nulls: 0] SZ:24 [more]...
price TV=3 RL=0 DL=1
----------------------------------------------------------------------------
page 0: DLE:RLE RLE:RLE VLE:PLAIN ST:[min: 2.50000, max: 2.50000, [more]... VC:3
date TV=3 RL=0 DL=0
----------------------------------------------------------------------------
page 0: DLE:RLE RLE:RLE VLE:PLAIN ST:[min: 1534690611464, max: 15 [more]... VC:3
in_stock TV=3 RL=0 DL=0
----------------------------------------------------------------------------
page 0: DLE:RLE RLE:RLE VLE:PLAIN ST:[min: true, max: true, num_nulls: 0] [more]...
BINARY name
*** row group 1 of 1, values 1 to 3 ***
value 1: R:0 D:0 V:apples
value 2: R:0 D:0 V:oranges
value 3: R:0 D:0 V:pears
INT64 quantity
*** row group 1 of 1, values 1 to 3 ***
value 1: R:0 D:0 V:10
value 2: R:0 D:0 V:10
value 3: R:0 D:0 V:10
DOUBLE price
*** row group 1 of 1, values 1 to 3 ***
value 1: R:0 D:1 V:2.5
value 2: R:0 D:1 V:2.5
value 3: R:0 D:0 V:
INT64 date
*** row group 1 of 1, values 1 to 3 ***
value 1: R:0 D:0 V:1534690611464
value 2: R:0 D:0 V:1534690611465
value 3: R:0 D:0 V:1534690611465
BOOLEAN in_stock
*** row group 1 of 1, values 1 to 3 ***
value 1: R:0 D:0 V:true
value 2: R:0 D:0 V:true
value 3: R:0 D:0 V:true