getTableMemoryUsage = (t) => {
const typedArrs = [];
t.batches.forEach(b => {
if(b.data.children[0].dictionary === undefined) {
typedArrs.push(b.data.children[0].values);
if(b.data.children[0].valueOffsets) {
typedArrs.push(b.data.children[0].valueOffsets);
}
} else {
typedArrs.push(b.data.children[0].values);
typedArrs.push(b.data.children[0].dictionary.data[0].values);
}
})
return typedArrs.map(a => a.length * a.BYTES_PER_ELEMENT).reduce((a, h) => a + h, 0);
}