Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Socket
Sign inDemoInstall

@loaders.gl/schema

Package Overview
Dependencies
Maintainers
7
Versions
187
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@loaders.gl/schema - npm Package Compare versions

Comparing version 3.1.0-beta.7 to 3.1.0

2

dist/es5/bundle.js
"use strict";
const moduleExports = require('./index');
var moduleExports = require('./index');

@@ -5,0 +5,0 @@ globalThis.loaders = globalThis.loaders || {};

"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {

@@ -9,2 +11,4 @@ value: true

var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
function convertMesh(mesh, shape, options) {

@@ -24,5 +28,9 @@ switch (shape || 'mesh') {

function convertMeshToColumnarTable(mesh) {
const columns = {};
var columns = {};
for (const [columnName, attribute] of Object.entries(mesh.attributes)) {
for (var _i = 0, _Object$entries = Object.entries(mesh.attributes); _i < _Object$entries.length; _i++) {
var _Object$entries$_i = (0, _slicedToArray2.default)(_Object$entries[_i], 2),
columnName = _Object$entries$_i[0],
attribute = _Object$entries$_i[1];
columns[columnName] = attribute.value;

@@ -29,0 +37,0 @@ }

@@ -15,3 +15,3 @@ "use strict";

function deduceMeshSchema(attributes, metadata) {
const fields = deduceMeshFields(attributes);
var fields = deduceMeshFields(attributes);
return new _schema.Schema(fields, metadata);

@@ -21,5 +21,5 @@ }

function deduceMeshField(attributeName, attribute, optionalMetadata) {
const type = (0, _arrowLikeTypeUtils.getArrowTypeFromTypedArray)(attribute.value);
const metadata = optionalMetadata ? optionalMetadata : makeMeshAttributeMetadata(attribute);
const field = new _schema.Field(attributeName, new _schema.FixedSizeList(attribute.size, new _schema.Field('value', type)), false, metadata);
var type = (0, _arrowLikeTypeUtils.getArrowTypeFromTypedArray)(attribute.value);
var metadata = optionalMetadata ? optionalMetadata : makeMeshAttributeMetadata(attribute);
var field = new _schema.Field(attributeName, new _schema.FixedSizeList(attribute.size, new _schema.Field('value', type)), false, metadata);
return field;

@@ -29,6 +29,6 @@ }

function deduceMeshFields(attributes) {
const fields = [];
var fields = [];
for (const attributeName in attributes) {
const attribute = attributes[attributeName];
for (var attributeName in attributes) {
var attribute = attributes[attributeName];
fields.push(deduceMeshField(attributeName, attribute));

@@ -41,3 +41,3 @@ }

function makeMeshAttributeMetadata(attribute) {
const result = new Map();
var result = new Map();

@@ -44,0 +44,0 @@ if ('byteOffset' in attribute) {

@@ -10,6 +10,6 @@ "use strict";

function getMeshSize(attributes) {
let size = 0;
var size = 0;
for (const attributeName in attributes) {
const attribute = attributes[attributeName];
for (var attributeName in attributes) {
var attribute = attributes[attributeName];

@@ -25,15 +25,15 @@ if (ArrayBuffer.isView(attribute)) {

function getMeshBoundingBox(attributes) {
let minX = Infinity;
let minY = Infinity;
let minZ = Infinity;
let maxX = -Infinity;
let maxY = -Infinity;
let maxZ = -Infinity;
const positions = attributes.POSITION ? attributes.POSITION.value : [];
const len = positions && positions.length;
var minX = Infinity;
var minY = Infinity;
var minZ = Infinity;
var maxX = -Infinity;
var maxY = -Infinity;
var maxZ = -Infinity;
var positions = attributes.POSITION ? attributes.POSITION.value : [];
var len = positions && positions.length;
for (let i = 0; i < len; i += 3) {
const x = positions[i];
const y = positions[i + 1];
const z = positions[i + 2];
for (var i = 0; i < len; i += 3) {
var x = positions[i];
var y = positions[i + 1];
var z = positions[i + 2];
minX = x < minX ? x : minX;

@@ -40,0 +40,0 @@ minY = y < minY ? y : minY;

@@ -9,3 +9,3 @@ "use strict";

function deduceTableSchema(table, schema) {
const deducedSchema = Array.isArray(table) ? deduceSchemaForRowTable(table) : deduceSchemaForColumnarTable(table);
var deducedSchema = Array.isArray(table) ? deduceSchemaForRowTable(table) : deduceSchemaForColumnarTable(table);
return Object.assign(deducedSchema, schema);

@@ -15,6 +15,6 @@ }

function deduceSchemaForColumnarTable(columnarTable) {
const schema = {};
var schema = {};
for (const field in columnarTable) {
const column = columnarTable[field];
for (var field in columnarTable) {
var column = columnarTable[field];

@@ -24,3 +24,3 @@ if (ArrayBuffer.isView(column)) {

} else if (column.length) {
const value = column[0];
var value = column[0];
schema[field] = deduceTypeFromValue(value);

@@ -36,9 +36,9 @@ }

function deduceSchemaForRowTable(rowTable) {
const schema = {};
var schema = {};
if (rowTable.length) {
const row = rowTable[0];
var row = rowTable[0];
for (const field in row) {
const value = row[field];
for (var field in row) {
var value = row[field];
schema[field] = deduceTypeFromValue(value);

@@ -45,0 +45,0 @@ }

@@ -10,3 +10,3 @@ "use strict";

enumerable: true,
get: function () {
get: function get() {
return _tableBatchBuilder.default;

@@ -17,3 +17,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _rowTableBatchAggregator.default;

@@ -24,3 +24,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _columnarTableBatchAggregator.default;

@@ -31,3 +31,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _rowUtils.convertToObjectRow;

@@ -38,3 +38,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _rowUtils.convertToArrayRow;

@@ -45,3 +45,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _meshUtils.getMeshSize;

@@ -52,3 +52,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _meshUtils.getMeshBoundingBox;

@@ -59,3 +59,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _convertMesh.convertMesh;

@@ -66,3 +66,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _deduceMeshSchema.deduceMeshSchema;

@@ -73,3 +73,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _deduceMeshSchema.deduceMeshField;

@@ -80,3 +80,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _deduceMeshSchema.makeMeshAttributeMetadata;

@@ -87,3 +87,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _schema.Schema;

@@ -94,3 +94,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _schema.Field;

@@ -101,3 +101,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _schema.DataType;

@@ -108,3 +108,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _schema.Null;

@@ -115,3 +115,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _schema.Binary;

@@ -122,3 +122,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _schema.Bool;

@@ -129,3 +129,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _schema.Int;

@@ -136,3 +136,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _schema.Int8;

@@ -143,3 +143,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _schema.Int16;

@@ -150,3 +150,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _schema.Int32;

@@ -157,3 +157,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _schema.Int64;

@@ -164,3 +164,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _schema.Uint8;

@@ -171,3 +171,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _schema.Uint16;

@@ -178,3 +178,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _schema.Uint32;

@@ -185,3 +185,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _schema.Uint64;

@@ -192,3 +192,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _schema.Float;

@@ -199,3 +199,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _schema.Float16;

@@ -206,3 +206,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _schema.Float32;

@@ -213,3 +213,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _schema.Float64;

@@ -220,3 +220,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _schema.Utf8;

@@ -227,3 +227,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _schema.Date;

@@ -234,3 +234,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _schema.DateDay;

@@ -241,3 +241,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _schema.DateMillisecond;

@@ -248,3 +248,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _schema.Time;

@@ -255,3 +255,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _schema.TimeMillisecond;

@@ -262,3 +262,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _schema.TimeSecond;

@@ -269,3 +269,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _schema.Timestamp;

@@ -276,3 +276,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _schema.TimestampSecond;

@@ -283,3 +283,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _schema.TimestampMillisecond;

@@ -290,3 +290,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _schema.TimestampMicrosecond;

@@ -297,3 +297,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _schema.TimestampNanosecond;

@@ -304,3 +304,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _schema.Interval;

@@ -311,3 +311,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _schema.IntervalDayTime;

@@ -318,3 +318,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _schema.IntervalYearMonth;

@@ -325,3 +325,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _schema.FixedSizeList;

@@ -332,3 +332,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _schema.Struct;

@@ -339,3 +339,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _deduceColumnType.deduceTypeFromColumn;

@@ -346,3 +346,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _deduceColumnType.deduceTypeFromValue;

@@ -353,3 +353,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _getTypeInfo.getTypeInfo;

@@ -360,3 +360,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _arrowLikeTypeUtils.getArrowTypeFromTypedArray;

@@ -367,3 +367,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _asyncQueue.default;

@@ -370,0 +370,0 @@ }

@@ -20,3 +20,3 @@ "use strict";

let ReverseType = null;
var ReverseType = null;

@@ -27,4 +27,4 @@ function getTypeKey(typeKey) {

for (const key in _schema.Type) {
ReverseType[_schema.Type[key]] = key;
for (var _key in _schema.Type) {
ReverseType[_schema.Type[_key]] = _key;
}

@@ -31,0 +31,0 @@ }

@@ -10,8 +10,13 @@ "use strict";

var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
const DEFAULT_ROW_COUNT = 100;
var DEFAULT_ROW_COUNT = 100;
class RowTableBatchAggregator {
constructor(schema, options) {
var RowTableBatchAggregator = function () {
function RowTableBatchAggregator(schema, options) {
(0, _classCallCheck2.default)(this, RowTableBatchAggregator);
(0, _defineProperty2.default)(this, "schema", void 0);

@@ -29,3 +34,3 @@ (0, _defineProperty2.default)(this, "options", void 0);

for (const key in schema) {
for (var key in schema) {
this._headers[schema[key].index] = schema[key].name;

@@ -36,49 +41,55 @@ }

rowCount() {
return this.length;
}
(0, _createClass2.default)(RowTableBatchAggregator, [{
key: "rowCount",
value: function rowCount() {
return this.length;
}
}, {
key: "addArrayRow",
value: function addArrayRow(row, cursor) {
if (Number.isFinite(cursor)) {
this.cursor = cursor;
}
addArrayRow(row, cursor) {
if (Number.isFinite(cursor)) {
this.cursor = cursor;
this.rows = this.rows || new Array(DEFAULT_ROW_COUNT);
this.rows[this.length] = row;
this.length++;
}
}, {
key: "addObjectRow",
value: function addObjectRow(row, cursor) {
if (Number.isFinite(cursor)) {
this.cursor = cursor;
}
this.rows = this.rows || new Array(DEFAULT_ROW_COUNT);
this.rows[this.length] = row;
this.length++;
}
addObjectRow(row, cursor) {
if (Number.isFinite(cursor)) {
this.cursor = cursor;
this.rows = this.rows || new Array(DEFAULT_ROW_COUNT);
this.rows[this.length] = row;
this.length++;
}
}, {
key: "getBatch",
value: function getBatch() {
var rows = this.rows;
this.rows = this.rows || new Array(DEFAULT_ROW_COUNT);
this.rows[this.length] = row;
this.length++;
}
if (!rows) {
return null;
}
getBatch() {
let rows = this.rows;
if (!rows) {
return null;
rows = rows.slice(0, this.length);
this.rows = null;
var batch = {
shape: this.options.shape,
batchType: 'data',
data: rows,
length: this.length,
schema: this.schema,
cursor: this.cursor
};
return batch;
}
}]);
return RowTableBatchAggregator;
}();
rows = rows.slice(0, this.length);
this.rows = null;
const batch = {
shape: this.options.shape,
batchType: 'data',
data: rows,
length: this.length,
schema: this.schema,
cursor: this.cursor
};
return batch;
}
}
exports.default = RowTableBatchAggregator;
//# sourceMappingURL=base-table-batch-aggregator.js.map

@@ -10,8 +10,15 @@ "use strict";

var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
const DEFAULT_ROW_COUNT = 100;
var DEFAULT_ROW_COUNT = 100;
class ColumnarTableBatchAggregator {
constructor(schema, options) {
var ColumnarTableBatchAggregator = function () {
function ColumnarTableBatchAggregator(schema, options) {
(0, _classCallCheck2.default)(this, ColumnarTableBatchAggregator);
(0, _defineProperty2.default)(this, "schema", void 0);

@@ -26,86 +33,98 @@ (0, _defineProperty2.default)(this, "length", 0);

rowCount() {
return this.length;
}
(0, _createClass2.default)(ColumnarTableBatchAggregator, [{
key: "rowCount",
value: function rowCount() {
return this.length;
}
}, {
key: "addArrayRow",
value: function addArrayRow(row) {
this._reallocateColumns();
addArrayRow(row) {
this._reallocateColumns();
var i = 0;
let i = 0;
for (var fieldName in this.columns) {
this.columns[fieldName][this.length] = row[i++];
}
for (const fieldName in this.columns) {
this.columns[fieldName][this.length] = row[i++];
this.length++;
}
}, {
key: "addObjectRow",
value: function addObjectRow(row) {
this._reallocateColumns();
this.length++;
}
for (var fieldName in row) {
this.columns[fieldName][this.length] = row[fieldName];
}
addObjectRow(row) {
this._reallocateColumns();
for (const fieldName in row) {
this.columns[fieldName][this.length] = row[fieldName];
this.length++;
}
}, {
key: "getBatch",
value: function getBatch() {
this._pruneColumns();
this.length++;
}
var columns = Array.isArray(this.schema) ? this.columns : {};
getBatch() {
this._pruneColumns();
const columns = Array.isArray(this.schema) ? this.columns : {};
if (!Array.isArray(this.schema)) {
for (const fieldName in this.schema) {
const field = this.schema[fieldName];
columns[field.name] = this.columns[field.index];
if (!Array.isArray(this.schema)) {
for (var fieldName in this.schema) {
var field = this.schema[fieldName];
columns[field.name] = this.columns[field.index];
}
}
}
this.columns = {};
const batch = {
shape: 'columnar-table',
batchType: 'data',
data: columns,
schema: this.schema,
length: this.length
};
return batch;
}
_reallocateColumns() {
if (this.length < this.allocated) {
return;
this.columns = {};
var batch = {
shape: 'columnar-table',
batchType: 'data',
data: columns,
schema: this.schema,
length: this.length
};
return batch;
}
}, {
key: "_reallocateColumns",
value: function _reallocateColumns() {
if (this.length < this.allocated) {
return;
}
this.allocated = this.allocated > 0 ? this.allocated *= 2 : DEFAULT_ROW_COUNT;
this.columns = {};
this.allocated = this.allocated > 0 ? this.allocated *= 2 : DEFAULT_ROW_COUNT;
this.columns = {};
for (const fieldName in this.schema) {
const field = this.schema[fieldName];
const ArrayType = field.type || Float32Array;
const oldColumn = this.columns[field.index];
for (var fieldName in this.schema) {
var field = this.schema[fieldName];
var ArrayType = field.type || Float32Array;
var oldColumn = this.columns[field.index];
if (oldColumn && ArrayBuffer.isView(oldColumn)) {
const typedArray = new ArrayType(this.allocated);
typedArray.set(oldColumn);
this.columns[field.index] = typedArray;
} else if (oldColumn) {
oldColumn.length = this.allocated;
this.columns[field.index] = oldColumn;
} else {
this.columns[field.index] = new ArrayType(this.allocated);
if (oldColumn && ArrayBuffer.isView(oldColumn)) {
var typedArray = new ArrayType(this.allocated);
typedArray.set(oldColumn);
this.columns[field.index] = typedArray;
} else if (oldColumn) {
oldColumn.length = this.allocated;
this.columns[field.index] = oldColumn;
} else {
this.columns[field.index] = new ArrayType(this.allocated);
}
}
}
}
}, {
key: "_pruneColumns",
value: function _pruneColumns() {
for (var _i = 0, _Object$entries = Object.entries(this.columns); _i < _Object$entries.length; _i++) {
var _Object$entries$_i = (0, _slicedToArray2.default)(_Object$entries[_i], 2),
_columnName = _Object$entries$_i[0],
column = _Object$entries$_i[1];
_pruneColumns() {
for (const [columnName, column] of Object.entries(this.columns)) {
this.columns[columnName] = column.slice(0, this.length);
this.columns[_columnName] = column.slice(0, this.length);
}
}
}
}]);
return ColumnarTableBatchAggregator;
}();
}
exports.default = ColumnarTableBatchAggregator;
//# sourceMappingURL=columnar-table-batch-aggregator.js.map

@@ -10,2 +10,6 @@ "use strict";

var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));

@@ -15,6 +19,7 @@

const DEFAULT_ROW_COUNT = 100;
var DEFAULT_ROW_COUNT = 100;
class RowTableBatchAggregator {
constructor(schema, options) {
var RowTableBatchAggregator = function () {
function RowTableBatchAggregator(schema, options) {
(0, _classCallCheck2.default)(this, RowTableBatchAggregator);
(0, _defineProperty2.default)(this, "schema", void 0);

@@ -33,3 +38,3 @@ (0, _defineProperty2.default)(this, "options", void 0);

for (const key in schema) {
for (var key in schema) {
this._headers[schema[key].index] = schema[key].name;

@@ -40,67 +45,73 @@ }

rowCount() {
return this.length;
}
addArrayRow(row, cursor) {
if (Number.isFinite(cursor)) {
this.cursor = cursor;
(0, _createClass2.default)(RowTableBatchAggregator, [{
key: "rowCount",
value: function rowCount() {
return this.length;
}
}, {
key: "addArrayRow",
value: function addArrayRow(row, cursor) {
if (Number.isFinite(cursor)) {
this.cursor = cursor;
}
switch (this.options.shape) {
case 'object-row-table':
const rowObject = (0, _rowUtils.convertToObjectRow)(row, this._headers);
this.addObjectRow(rowObject, cursor);
break;
switch (this.options.shape) {
case 'object-row-table':
var rowObject = (0, _rowUtils.convertToObjectRow)(row, this._headers);
this.addObjectRow(rowObject, cursor);
break;
case 'array-row-table':
this.arrayRows = this.arrayRows || new Array(DEFAULT_ROW_COUNT);
this.arrayRows[this.length] = row;
this.length++;
break;
case 'array-row-table':
this.arrayRows = this.arrayRows || new Array(DEFAULT_ROW_COUNT);
this.arrayRows[this.length] = row;
this.length++;
break;
}
}
}
}, {
key: "addObjectRow",
value: function addObjectRow(row, cursor) {
if (Number.isFinite(cursor)) {
this.cursor = cursor;
}
addObjectRow(row, cursor) {
if (Number.isFinite(cursor)) {
this.cursor = cursor;
}
switch (this.options.shape) {
case 'array-row-table':
var rowArray = (0, _rowUtils.convertToArrayRow)(row, this._headers);
this.addArrayRow(rowArray, cursor);
break;
switch (this.options.shape) {
case 'array-row-table':
const rowArray = (0, _rowUtils.convertToArrayRow)(row, this._headers);
this.addArrayRow(rowArray, cursor);
break;
case 'object-row-table':
this.objectRows = this.objectRows || new Array(DEFAULT_ROW_COUNT);
this.objectRows[this.length] = row;
this.length++;
break;
case 'object-row-table':
this.objectRows = this.objectRows || new Array(DEFAULT_ROW_COUNT);
this.objectRows[this.length] = row;
this.length++;
break;
}
}
}
}, {
key: "getBatch",
value: function getBatch() {
var rows = this.arrayRows || this.objectRows;
getBatch() {
let rows = this.arrayRows || this.objectRows;
if (!rows) {
return null;
}
if (!rows) {
return null;
rows = rows.slice(0, this.length);
this.arrayRows = null;
this.objectRows = null;
return {
shape: this.options.shape,
batchType: 'data',
data: rows,
length: this.length,
schema: this.schema,
cursor: this.cursor
};
}
}]);
return RowTableBatchAggregator;
}();
rows = rows.slice(0, this.length);
this.arrayRows = null;
this.objectRows = null;
return {
shape: this.options.shape,
batchType: 'data',
data: rows,
length: this.length,
schema: this.schema,
cursor: this.cursor
};
}
}
exports.default = RowTableBatchAggregator;
//# sourceMappingURL=row-table-batch-aggregator.js.map

@@ -10,2 +10,6 @@ "use strict";

var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));

@@ -19,3 +23,7 @@

const DEFAULT_OPTIONS = {
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
var DEFAULT_OPTIONS = {
shape: 'array-row-table',

@@ -27,6 +35,7 @@ batchSize: 'auto',

};
const ERR_MESSAGE = 'TableBatchBuilder';
var ERR_MESSAGE = 'TableBatchBuilder';
class TableBatchBuilder {
constructor(schema, options) {
var TableBatchBuilder = function () {
function TableBatchBuilder(schema, options) {
(0, _classCallCheck2.default)(this, TableBatchBuilder);
(0, _defineProperty2.default)(this, "schema", void 0);

@@ -43,149 +52,160 @@ (0, _defineProperty2.default)(this, "options", void 0);

this.schema = schema;
this.options = { ...DEFAULT_OPTIONS,
...options
};
this.options = _objectSpread(_objectSpread({}, DEFAULT_OPTIONS), options);
}
limitReached() {
var _this$options, _this$options2;
(0, _createClass2.default)(TableBatchBuilder, [{
key: "limitReached",
value: function limitReached() {
var _this$options, _this$options2;
if (Boolean((_this$options = this.options) === null || _this$options === void 0 ? void 0 : _this$options.limit) && this.totalLength >= this.options.limit) {
return true;
}
if (Boolean((_this$options = this.options) === null || _this$options === void 0 ? void 0 : _this$options.limit) && this.totalLength >= this.options.limit) {
return true;
}
if (Boolean((_this$options2 = this.options) === null || _this$options2 === void 0 ? void 0 : _this$options2._limitMB) && this.totalBytes / 1e6 >= this.options._limitMB) {
return true;
}
if (Boolean((_this$options2 = this.options) === null || _this$options2 === void 0 ? void 0 : _this$options2._limitMB) && this.totalBytes / 1e6 >= this.options._limitMB) {
return true;
}
return false;
}
addRow(row) {
if (this.limitReached()) {
return;
return false;
}
}, {
key: "addRow",
value: function addRow(row) {
if (this.limitReached()) {
return;
}
this.totalLength++;
this.rowBytes = this.rowBytes || this._estimateRowMB(row);
this.totalBytes += this.rowBytes;
this.totalLength++;
this.rowBytes = this.rowBytes || this._estimateRowMB(row);
this.totalBytes += this.rowBytes;
if (Array.isArray(row)) {
this.addArrayRow(row);
} else {
this.addObjectRow(row);
if (Array.isArray(row)) {
this.addArrayRow(row);
} else {
this.addObjectRow(row);
}
}
}
}, {
key: "addArrayRow",
value: function addArrayRow(row) {
if (!this.aggregator) {
var TableBatchType = this._getTableBatchType();
addArrayRow(row) {
if (!this.aggregator) {
const TableBatchType = this._getTableBatchType();
this.aggregator = new TableBatchType(this.schema, this.options);
}
this.aggregator = new TableBatchType(this.schema, this.options);
this.aggregator.addArrayRow(row);
}
}, {
key: "addObjectRow",
value: function addObjectRow(row) {
if (!this.aggregator) {
var TableBatchType = this._getTableBatchType();
this.aggregator.addArrayRow(row);
}
this.aggregator = new TableBatchType(this.schema, this.options);
}
addObjectRow(row) {
if (!this.aggregator) {
const TableBatchType = this._getTableBatchType();
this.aggregator = new TableBatchType(this.schema, this.options);
this.aggregator.addObjectRow(row);
}
}, {
key: "chunkComplete",
value: function chunkComplete(chunk) {
if (chunk instanceof ArrayBuffer) {
this.bytesUsed += chunk.byteLength;
}
this.aggregator.addObjectRow(row);
}
if (typeof chunk === 'string') {
this.bytesUsed += chunk.length;
}
chunkComplete(chunk) {
if (chunk instanceof ArrayBuffer) {
this.bytesUsed += chunk.byteLength;
this.isChunkComplete = true;
}
if (typeof chunk === 'string') {
this.bytesUsed += chunk.length;
}, {
key: "getFullBatch",
value: function getFullBatch(options) {
return this._isFull() ? this._getBatch(options) : null;
}
this.isChunkComplete = true;
}
getFullBatch(options) {
return this._isFull() ? this._getBatch(options) : null;
}
getFinalBatch(options) {
return this._getBatch(options);
}
_estimateRowMB(row) {
return Array.isArray(row) ? row.length * 8 : Object.keys(row).length * 8;
}
_isFull() {
if (!this.aggregator || this.aggregator.rowCount() === 0) {
return false;
}, {
key: "getFinalBatch",
value: function getFinalBatch(options) {
return this._getBatch(options);
}
}, {
key: "_estimateRowMB",
value: function _estimateRowMB(row) {
return Array.isArray(row) ? row.length * 8 : Object.keys(row).length * 8;
}
}, {
key: "_isFull",
value: function _isFull() {
if (!this.aggregator || this.aggregator.rowCount() === 0) {
return false;
}
if (this.options.batchSize === 'auto') {
if (!this.isChunkComplete) {
if (this.options.batchSize === 'auto') {
if (!this.isChunkComplete) {
return false;
}
} else if (this.options.batchSize > this.aggregator.rowCount()) {
return false;
}
} else if (this.options.batchSize > this.aggregator.rowCount()) {
return false;
}
if (this.options.batchDebounceMs > Date.now() - this.lastBatchEmittedMs) {
return false;
if (this.options.batchDebounceMs > Date.now() - this.lastBatchEmittedMs) {
return false;
}
this.isChunkComplete = false;
this.lastBatchEmittedMs = Date.now();
return true;
}
}, {
key: "_getBatch",
value: function _getBatch(options) {
if (!this.aggregator) {
return null;
}
this.isChunkComplete = false;
this.lastBatchEmittedMs = Date.now();
return true;
}
if (options !== null && options !== void 0 && options.bytesUsed) {
this.bytesUsed = options.bytesUsed;
}
_getBatch(options) {
if (!this.aggregator) {
return null;
var normalizedBatch = this.aggregator.getBatch();
normalizedBatch.count = this.batchCount;
normalizedBatch.bytesUsed = this.bytesUsed;
Object.assign(normalizedBatch, options);
this.batchCount++;
this.aggregator = null;
return normalizedBatch;
}
}, {
key: "_getTableBatchType",
value: function _getTableBatchType() {
switch (this.options.shape) {
case 'row-table':
return _baseTableBatchAggregator.default;
if (options !== null && options !== void 0 && options.bytesUsed) {
this.bytesUsed = options.bytesUsed;
}
case 'array-row-table':
case 'object-row-table':
return _rowTableBatchAggregator.default;
const normalizedBatch = this.aggregator.getBatch();
normalizedBatch.count = this.batchCount;
normalizedBatch.bytesUsed = this.bytesUsed;
Object.assign(normalizedBatch, options);
this.batchCount++;
this.aggregator = null;
return normalizedBatch;
}
case 'columnar-table':
return _columnarTableBatchAggregator.default;
_getTableBatchType() {
switch (this.options.shape) {
case 'row-table':
return _baseTableBatchAggregator.default;
case 'arrow-table':
if (!TableBatchBuilder.ArrowBatch) {
throw new Error(ERR_MESSAGE);
}
case 'array-row-table':
case 'object-row-table':
return _rowTableBatchAggregator.default;
return TableBatchBuilder.ArrowBatch;
case 'columnar-table':
return _columnarTableBatchAggregator.default;
case 'arrow-table':
if (!TableBatchBuilder.ArrowBatch) {
default:
throw new Error(ERR_MESSAGE);
}
return TableBatchBuilder.ArrowBatch;
default:
throw new Error(ERR_MESSAGE);
}
}
}
}]);
return TableBatchBuilder;
}();
}
exports.default = TableBatchBuilder;
(0, _defineProperty2.default)(TableBatchBuilder, "ArrowBatch", void 0);
//# sourceMappingURL=table-batch-builder.js.map

@@ -7,3 +7,3 @@ "use strict";

exports.Type = void 0;
let Type;
var Type;
exports.Type = Type;

@@ -10,0 +10,0 @@

@@ -10,6 +10,13 @@ "use strict";

var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
class Field {
constructor(name, type, nullable = false, metadata = new Map()) {
var Field = function () {
function Field(name, type) {
var nullable = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
var metadata = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : new Map();
(0, _classCallCheck2.default)(this, Field);
(0, _defineProperty2.default)(this, "name", void 0);

@@ -25,21 +32,27 @@ (0, _defineProperty2.default)(this, "type", void 0);

get typeId() {
return this.type && this.type.typeId;
}
(0, _createClass2.default)(Field, [{
key: "typeId",
get: function get() {
return this.type && this.type.typeId;
}
}, {
key: "clone",
value: function clone() {
return new Field(this.name, this.type, this.nullable, this.metadata);
}
}, {
key: "compareTo",
value: function compareTo(other) {
return this.name === other.name && this.type === other.type && this.nullable === other.nullable && this.metadata === other.metadata;
}
}, {
key: "toString",
value: function toString() {
return "".concat(this.type).concat(this.nullable ? ', nullable' : '').concat(this.metadata ? ", metadata: ".concat(this.metadata) : '');
}
}]);
return Field;
}();
clone() {
return new Field(this.name, this.type, this.nullable, this.metadata);
}
compareTo(other) {
return this.name === other.name && this.type === other.type && this.nullable === other.nullable && this.metadata === other.metadata;
}
toString() {
return "".concat(this.type).concat(this.nullable ? ', nullable' : '').concat(this.metadata ? ", metadata: ".concat(this.metadata) : '');
}
}
exports.default = Field;
//# sourceMappingURL=field.js.map

@@ -10,2 +10,8 @@ "use strict";

var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));

@@ -15,4 +21,11 @@

class Schema {
constructor(fields, metadata) {
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
var Schema = function () {
function Schema(fields, metadata) {
(0, _classCallCheck2.default)(this, Schema);
(0, _defineProperty2.default)(this, "fields", void 0);

@@ -26,63 +39,104 @@ (0, _defineProperty2.default)(this, "metadata", void 0);

compareTo(other) {
if (this.metadata !== other.metadata) {
return false;
}
(0, _createClass2.default)(Schema, [{
key: "compareTo",
value: function compareTo(other) {
if (this.metadata !== other.metadata) {
return false;
}
if (this.fields.length !== other.fields.length) {
return false;
}
for (let i = 0; i < this.fields.length; ++i) {
if (!this.fields[i].compareTo(other.fields[i])) {
if (this.fields.length !== other.fields.length) {
return false;
}
for (var i = 0; i < this.fields.length; ++i) {
if (!this.fields[i].compareTo(other.fields[i])) {
return false;
}
}
return true;
}
}, {
key: "select",
value: function select() {
var nameMap = Object.create(null);
return true;
}
for (var _len = arguments.length, columnNames = new Array(_len), _key = 0; _key < _len; _key++) {
columnNames[_key] = arguments[_key];
}
select(...columnNames) {
const nameMap = Object.create(null);
for (var _i = 0, _columnNames = columnNames; _i < _columnNames.length; _i++) {
var name = _columnNames[_i];
nameMap[name] = true;
}
for (const name of columnNames) {
nameMap[name] = true;
var selectedFields = this.fields.filter(function (field) {
return nameMap[field.name];
});
return new Schema(selectedFields, this.metadata);
}
}, {
key: "selectAt",
value: function selectAt() {
var _this = this;
const selectedFields = this.fields.filter(field => nameMap[field.name]);
return new Schema(selectedFields, this.metadata);
}
for (var _len2 = arguments.length, columnIndices = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
columnIndices[_key2] = arguments[_key2];
}
selectAt(...columnIndices) {
const selectedFields = columnIndices.map(index => this.fields[index]).filter(Boolean);
return new Schema(selectedFields, this.metadata);
}
var selectedFields = columnIndices.map(function (index) {
return _this.fields[index];
}).filter(Boolean);
return new Schema(selectedFields, this.metadata);
}
}, {
key: "assign",
value: function assign(schemaOrFields) {
var fields;
var metadata = this.metadata;
assign(schemaOrFields) {
let fields;
let metadata = this.metadata;
if (schemaOrFields instanceof Schema) {
var otherSchema = schemaOrFields;
fields = otherSchema.fields;
metadata = mergeMaps(mergeMaps(new Map(), this.metadata), otherSchema.metadata);
} else {
fields = schemaOrFields;
}
if (schemaOrFields instanceof Schema) {
const otherSchema = schemaOrFields;
fields = otherSchema.fields;
metadata = mergeMaps(mergeMaps(new Map(), this.metadata), otherSchema.metadata);
} else {
fields = schemaOrFields;
}
var fieldMap = Object.create(null);
const fieldMap = Object.create(null);
var _iterator = _createForOfIteratorHelper(this.fields),
_step;
for (const field of this.fields) {
fieldMap[field.name] = field;
}
try {
for (_iterator.s(); !(_step = _iterator.n()).done;) {
var field = _step.value;
fieldMap[field.name] = field;
}
} catch (err) {
_iterator.e(err);
} finally {
_iterator.f();
}
for (const field of fields) {
fieldMap[field.name] = field;
}
var _iterator2 = _createForOfIteratorHelper(fields),
_step2;
const mergedFields = Object.values(fieldMap);
return new Schema(mergedFields, metadata);
}
try {
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
var _field = _step2.value;
fieldMap[_field.name] = _field;
}
} catch (err) {
_iterator2.e(err);
} finally {
_iterator2.f();
}
}
var mergedFields = Object.values(fieldMap);
return new Schema(mergedFields, metadata);
}
}]);
return Schema;
}();

@@ -92,10 +146,21 @@ exports.default = Schema;

function checkNames(fields) {
const usedNames = {};
var usedNames = {};
for (const field of fields) {
if (usedNames[field.name]) {
console.warn('Schema: duplicated field name', field.name, field);
var _iterator3 = _createForOfIteratorHelper(fields),
_step3;
try {
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
var field = _step3.value;
if (usedNames[field.name]) {
console.warn('Schema: duplicated field name', field.name, field);
}
usedNames[field.name] = true;
}
usedNames[field.name] = true;
} catch (err) {
_iterator3.e(err);
} finally {
_iterator3.f();
}

@@ -105,4 +170,4 @@ }

function mergeMaps(m1, m2) {
return new Map([...(m1 || new Map()), ...(m2 || new Map())]);
return new Map([].concat((0, _toConsumableArray2.default)(m1 || new Map()), (0, _toConsumableArray2.default)(m2 || new Map())));
}
//# sourceMappingURL=schema.js.map

@@ -10,3 +10,3 @@ "use strict";

enumerable: true,
get: function () {
get: function get() {
return _enum.Type;

@@ -17,225 +17,356 @@ }

var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _enum = require("./enum");
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
let _Symbol$toStringTag, _Symbol$toStringTag2, _Symbol$toStringTag3, _Symbol$toStringTag4, _Symbol$toStringTag5, _Symbol$toStringTag6, _Symbol$toStringTag7, _Symbol$toStringTag8;
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
class DataType {
static isNull(x) {
return x && x.typeId === _enum.Type.Null;
}
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
static isInt(x) {
return x && x.typeId === _enum.Type.Int;
}
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
static isFloat(x) {
return x && x.typeId === _enum.Type.Float;
}
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
static isBinary(x) {
return x && x.typeId === _enum.Type.Binary;
}
var _enum = require("./enum");
static isUtf8(x) {
return x && x.typeId === _enum.Type.Utf8;
}
var _Symbol$toStringTag, _Symbol$toStringTag2, _Symbol$toStringTag3, _Symbol$toStringTag4, _Symbol$toStringTag5, _Symbol$toStringTag6, _Symbol$toStringTag7, _Symbol$toStringTag8;
static isBool(x) {
return x && x.typeId === _enum.Type.Bool;
}
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
static isDecimal(x) {
return x && x.typeId === _enum.Type.Decimal;
}
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
static isDate(x) {
return x && x.typeId === _enum.Type.Date;
var DataType = function () {
function DataType() {
(0, _classCallCheck2.default)(this, DataType);
}
static isTime(x) {
return x && x.typeId === _enum.Type.Time;
}
(0, _createClass2.default)(DataType, [{
key: "typeId",
get: function get() {
return _enum.Type.NONE;
}
}, {
key: "compareTo",
value: function compareTo(other) {
return this === other;
}
}], [{
key: "isNull",
value: function isNull(x) {
return x && x.typeId === _enum.Type.Null;
}
}, {
key: "isInt",
value: function isInt(x) {
return x && x.typeId === _enum.Type.Int;
}
}, {
key: "isFloat",
value: function isFloat(x) {
return x && x.typeId === _enum.Type.Float;
}
}, {
key: "isBinary",
value: function isBinary(x) {
return x && x.typeId === _enum.Type.Binary;
}
}, {
key: "isUtf8",
value: function isUtf8(x) {
return x && x.typeId === _enum.Type.Utf8;
}
}, {
key: "isBool",
value: function isBool(x) {
return x && x.typeId === _enum.Type.Bool;
}
}, {
key: "isDecimal",
value: function isDecimal(x) {
return x && x.typeId === _enum.Type.Decimal;
}
}, {
key: "isDate",
value: function isDate(x) {
return x && x.typeId === _enum.Type.Date;
}
}, {
key: "isTime",
value: function isTime(x) {
return x && x.typeId === _enum.Type.Time;
}
}, {
key: "isTimestamp",
value: function isTimestamp(x) {
return x && x.typeId === _enum.Type.Timestamp;
}
}, {
key: "isInterval",
value: function isInterval(x) {
return x && x.typeId === _enum.Type.Interval;
}
}, {
key: "isList",
value: function isList(x) {
return x && x.typeId === _enum.Type.List;
}
}, {
key: "isStruct",
value: function isStruct(x) {
return x && x.typeId === _enum.Type.Struct;
}
}, {
key: "isUnion",
value: function isUnion(x) {
return x && x.typeId === _enum.Type.Union;
}
}, {
key: "isFixedSizeBinary",
value: function isFixedSizeBinary(x) {
return x && x.typeId === _enum.Type.FixedSizeBinary;
}
}, {
key: "isFixedSizeList",
value: function isFixedSizeList(x) {
return x && x.typeId === _enum.Type.FixedSizeList;
}
}, {
key: "isMap",
value: function isMap(x) {
return x && x.typeId === _enum.Type.Map;
}
}, {
key: "isDictionary",
value: function isDictionary(x) {
return x && x.typeId === _enum.Type.Dictionary;
}
}]);
return DataType;
}();
static isTimestamp(x) {
return x && x.typeId === _enum.Type.Timestamp;
}
exports.DataType = DataType;
static isInterval(x) {
return x && x.typeId === _enum.Type.Interval;
}
var Null = function (_DataType) {
(0, _inherits2.default)(Null, _DataType);
static isList(x) {
return x && x.typeId === _enum.Type.List;
}
var _super = _createSuper(Null);
static isStruct(x) {
return x && x.typeId === _enum.Type.Struct;
function Null() {
(0, _classCallCheck2.default)(this, Null);
return _super.apply(this, arguments);
}
static isUnion(x) {
return x && x.typeId === _enum.Type.Union;
}
(0, _createClass2.default)(Null, [{
key: "typeId",
get: function get() {
return _enum.Type.Null;
}
}, {
key: Symbol.toStringTag,
get: function get() {
return 'Null';
}
}, {
key: "toString",
value: function toString() {
return 'Null';
}
}]);
return Null;
}(DataType);
static isFixedSizeBinary(x) {
return x && x.typeId === _enum.Type.FixedSizeBinary;
}
exports.Null = Null;
static isFixedSizeList(x) {
return x && x.typeId === _enum.Type.FixedSizeList;
}
var Bool = function (_DataType2) {
(0, _inherits2.default)(Bool, _DataType2);
static isMap(x) {
return x && x.typeId === _enum.Type.Map;
}
var _super2 = _createSuper(Bool);
static isDictionary(x) {
return x && x.typeId === _enum.Type.Dictionary;
function Bool() {
(0, _classCallCheck2.default)(this, Bool);
return _super2.apply(this, arguments);
}
get typeId() {
return _enum.Type.NONE;
}
(0, _createClass2.default)(Bool, [{
key: "typeId",
get: function get() {
return _enum.Type.Bool;
}
}, {
key: Symbol.toStringTag,
get: function get() {
return 'Bool';
}
}, {
key: "toString",
value: function toString() {
return 'Bool';
}
}]);
return Bool;
}(DataType);
compareTo(other) {
return this === other;
}
exports.Bool = Bool;
_Symbol$toStringTag = Symbol.toStringTag;
}
var Int = function (_DataType3) {
(0, _inherits2.default)(Int, _DataType3);
exports.DataType = DataType;
var _super3 = _createSuper(Int);
class Null extends DataType {
get typeId() {
return _enum.Type.Null;
}
function Int(isSigned, bitWidth) {
var _this;
get [Symbol.toStringTag]() {
return 'Null';
(0, _classCallCheck2.default)(this, Int);
_this = _super3.call(this);
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "isSigned", void 0);
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "bitWidth", void 0);
_this.isSigned = isSigned;
_this.bitWidth = bitWidth;
return _this;
}
toString() {
return 'Null';
}
(0, _createClass2.default)(Int, [{
key: "typeId",
get: function get() {
return _enum.Type.Int;
}
}, {
key: _Symbol$toStringTag,
get: function get() {
return 'Int';
}
}, {
key: "toString",
value: function toString() {
return "".concat(this.isSigned ? 'I' : 'Ui', "nt").concat(this.bitWidth);
}
}]);
return Int;
}(DataType);
}
exports.Int = Int;
exports.Null = Null;
var Int8 = function (_Int) {
(0, _inherits2.default)(Int8, _Int);
class Bool extends DataType {
get typeId() {
return _enum.Type.Bool;
}
var _super4 = _createSuper(Int8);
get [Symbol.toStringTag]() {
return 'Bool';
function Int8() {
(0, _classCallCheck2.default)(this, Int8);
return _super4.call(this, true, 8);
}
toString() {
return 'Bool';
}
return Int8;
}(Int);
}
exports.Int8 = Int8;
exports.Bool = Bool;
_Symbol$toStringTag = Symbol.toStringTag;
var Int16 = function (_Int2) {
(0, _inherits2.default)(Int16, _Int2);
class Int extends DataType {
constructor(isSigned, bitWidth) {
super();
(0, _defineProperty2.default)(this, "isSigned", void 0);
(0, _defineProperty2.default)(this, "bitWidth", void 0);
this.isSigned = isSigned;
this.bitWidth = bitWidth;
}
var _super5 = _createSuper(Int16);
get typeId() {
return _enum.Type.Int;
function Int16() {
(0, _classCallCheck2.default)(this, Int16);
return _super5.call(this, true, 16);
}
get [_Symbol$toStringTag]() {
return 'Int';
}
return Int16;
}(Int);
toString() {
return "".concat(this.isSigned ? 'I' : 'Ui', "nt").concat(this.bitWidth);
}
exports.Int16 = Int16;
}
var Int32 = function (_Int3) {
(0, _inherits2.default)(Int32, _Int3);
exports.Int = Int;
var _super6 = _createSuper(Int32);
class Int8 extends Int {
constructor() {
super(true, 8);
function Int32() {
(0, _classCallCheck2.default)(this, Int32);
return _super6.call(this, true, 32);
}
}
return Int32;
}(Int);
exports.Int8 = Int8;
exports.Int32 = Int32;
class Int16 extends Int {
constructor() {
super(true, 16);
}
var Int64 = function (_Int4) {
(0, _inherits2.default)(Int64, _Int4);
}
var _super7 = _createSuper(Int64);
exports.Int16 = Int16;
class Int32 extends Int {
constructor() {
super(true, 32);
function Int64() {
(0, _classCallCheck2.default)(this, Int64);
return _super7.call(this, true, 64);
}
}
return Int64;
}(Int);
exports.Int32 = Int32;
exports.Int64 = Int64;
class Int64 extends Int {
constructor() {
super(true, 64);
}
var Uint8 = function (_Int5) {
(0, _inherits2.default)(Uint8, _Int5);
}
var _super8 = _createSuper(Uint8);
exports.Int64 = Int64;
class Uint8 extends Int {
constructor() {
super(false, 8);
function Uint8() {
(0, _classCallCheck2.default)(this, Uint8);
return _super8.call(this, false, 8);
}
}
return Uint8;
}(Int);
exports.Uint8 = Uint8;
class Uint16 extends Int {
constructor() {
super(false, 16);
var Uint16 = function (_Int6) {
(0, _inherits2.default)(Uint16, _Int6);
var _super9 = _createSuper(Uint16);
function Uint16() {
(0, _classCallCheck2.default)(this, Uint16);
return _super9.call(this, false, 16);
}
}
return Uint16;
}(Int);
exports.Uint16 = Uint16;
class Uint32 extends Int {
constructor() {
super(false, 32);
var Uint32 = function (_Int7) {
(0, _inherits2.default)(Uint32, _Int7);
var _super10 = _createSuper(Uint32);
function Uint32() {
(0, _classCallCheck2.default)(this, Uint32);
return _super10.call(this, false, 32);
}
}
return Uint32;
}(Int);
exports.Uint32 = Uint32;
class Uint64 extends Int {
constructor() {
super(false, 64);
var Uint64 = function (_Int8) {
(0, _inherits2.default)(Uint64, _Int8);
var _super11 = _createSuper(Uint64);
function Uint64() {
(0, _classCallCheck2.default)(this, Uint64);
return _super11.call(this, false, 64);
}
}
return Uint64;
}(Int);
exports.Uint64 = Uint64;
const Precision = {
var Precision = {
HALF: 16,

@@ -247,90 +378,145 @@ SINGLE: 32,

class Float extends DataType {
constructor(precision) {
super();
(0, _defineProperty2.default)(this, "precision", void 0);
this.precision = precision;
}
var Float = function (_DataType4) {
(0, _inherits2.default)(Float, _DataType4);
get typeId() {
return _enum.Type.Float;
}
var _super12 = _createSuper(Float);
get [_Symbol$toStringTag2]() {
return 'Float';
}
function Float(precision) {
var _this2;
toString() {
return "Float".concat(this.precision);
(0, _classCallCheck2.default)(this, Float);
_this2 = _super12.call(this);
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this2), "precision", void 0);
_this2.precision = precision;
return _this2;
}
}
(0, _createClass2.default)(Float, [{
key: "typeId",
get: function get() {
return _enum.Type.Float;
}
}, {
key: _Symbol$toStringTag2,
get: function get() {
return 'Float';
}
}, {
key: "toString",
value: function toString() {
return "Float".concat(this.precision);
}
}]);
return Float;
}(DataType);
exports.Float = Float;
class Float16 extends Float {
constructor() {
super(Precision.HALF);
var Float16 = function (_Float) {
(0, _inherits2.default)(Float16, _Float);
var _super13 = _createSuper(Float16);
function Float16() {
(0, _classCallCheck2.default)(this, Float16);
return _super13.call(this, Precision.HALF);
}
}
return Float16;
}(Float);
exports.Float16 = Float16;
class Float32 extends Float {
constructor() {
super(Precision.SINGLE);
var Float32 = function (_Float2) {
(0, _inherits2.default)(Float32, _Float2);
var _super14 = _createSuper(Float32);
function Float32() {
(0, _classCallCheck2.default)(this, Float32);
return _super14.call(this, Precision.SINGLE);
}
}
return Float32;
}(Float);
exports.Float32 = Float32;
class Float64 extends Float {
constructor() {
super(Precision.DOUBLE);
var Float64 = function (_Float3) {
(0, _inherits2.default)(Float64, _Float3);
var _super15 = _createSuper(Float64);
function Float64() {
(0, _classCallCheck2.default)(this, Float64);
return _super15.call(this, Precision.DOUBLE);
}
}
return Float64;
}(Float);
exports.Float64 = Float64;
class Binary extends DataType {
constructor() {
super();
}
var Binary = function (_DataType5) {
(0, _inherits2.default)(Binary, _DataType5);
get typeId() {
return _enum.Type.Binary;
}
var _super16 = _createSuper(Binary);
toString() {
return 'Binary';
function Binary() {
(0, _classCallCheck2.default)(this, Binary);
return _super16.call(this);
}
get [Symbol.toStringTag]() {
return 'Binary';
}
(0, _createClass2.default)(Binary, [{
key: "typeId",
get: function get() {
return _enum.Type.Binary;
}
}, {
key: "toString",
value: function toString() {
return 'Binary';
}
}, {
key: Symbol.toStringTag,
get: function get() {
return 'Binary';
}
}]);
return Binary;
}(DataType);
}
exports.Binary = Binary;
class Utf8 extends DataType {
get typeId() {
return _enum.Type.Utf8;
}
var Utf8 = function (_DataType6) {
(0, _inherits2.default)(Utf8, _DataType6);
get [Symbol.toStringTag]() {
return 'Utf8';
}
var _super17 = _createSuper(Utf8);
toString() {
return 'Utf8';
function Utf8() {
(0, _classCallCheck2.default)(this, Utf8);
return _super17.apply(this, arguments);
}
}
(0, _createClass2.default)(Utf8, [{
key: "typeId",
get: function get() {
return _enum.Type.Utf8;
}
}, {
key: Symbol.toStringTag,
get: function get() {
return 'Utf8';
}
}, {
key: "toString",
value: function toString() {
return 'Utf8';
}
}]);
return Utf8;
}(DataType);
exports.Utf8 = Utf8;
const DateUnit = {
var DateUnit = {
DAY: 0,

@@ -341,43 +527,68 @@ MILLISECOND: 1

class Date extends DataType {
constructor(unit) {
super();
(0, _defineProperty2.default)(this, "unit", void 0);
this.unit = unit;
}
var Date = function (_DataType7) {
(0, _inherits2.default)(Date, _DataType7);
get typeId() {
return _enum.Type.Date;
}
var _super18 = _createSuper(Date);
get [_Symbol$toStringTag3]() {
return 'Date';
}
function Date(unit) {
var _this3;
toString() {
return "Date".concat((this.unit + 1) * 32, "<").concat(DateUnit[this.unit], ">");
(0, _classCallCheck2.default)(this, Date);
_this3 = _super18.call(this);
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this3), "unit", void 0);
_this3.unit = unit;
return _this3;
}
}
(0, _createClass2.default)(Date, [{
key: "typeId",
get: function get() {
return _enum.Type.Date;
}
}, {
key: _Symbol$toStringTag3,
get: function get() {
return 'Date';
}
}, {
key: "toString",
value: function toString() {
return "Date".concat((this.unit + 1) * 32, "<").concat(DateUnit[this.unit], ">");
}
}]);
return Date;
}(DataType);
exports.Date = Date;
class DateDay extends Date {
constructor() {
super(DateUnit.DAY);
var DateDay = function (_Date) {
(0, _inherits2.default)(DateDay, _Date);
var _super19 = _createSuper(DateDay);
function DateDay() {
(0, _classCallCheck2.default)(this, DateDay);
return _super19.call(this, DateUnit.DAY);
}
}
return DateDay;
}(Date);
exports.DateDay = DateDay;
class DateMillisecond extends Date {
constructor() {
super(DateUnit.MILLISECOND);
var DateMillisecond = function (_Date2) {
(0, _inherits2.default)(DateMillisecond, _Date2);
var _super20 = _createSuper(DateMillisecond);
function DateMillisecond() {
(0, _classCallCheck2.default)(this, DateMillisecond);
return _super20.call(this, DateUnit.MILLISECOND);
}
}
return DateMillisecond;
}(Date);
exports.DateMillisecond = DateMillisecond;
const TimeUnit = {
var TimeUnit = {
SECOND: 1,

@@ -390,42 +601,67 @@ MILLISECOND: 1e3,

class Time extends DataType {
constructor(unit, bitWidth) {
super();
(0, _defineProperty2.default)(this, "unit", void 0);
(0, _defineProperty2.default)(this, "bitWidth", void 0);
this.unit = unit;
this.bitWidth = bitWidth;
}
var Time = function (_DataType8) {
(0, _inherits2.default)(Time, _DataType8);
get typeId() {
return _enum.Type.Time;
}
var _super21 = _createSuper(Time);
toString() {
return "Time".concat(this.bitWidth, "<").concat(TimeUnit[this.unit], ">");
}
function Time(unit, bitWidth) {
var _this4;
get [_Symbol$toStringTag4]() {
return 'Time';
(0, _classCallCheck2.default)(this, Time);
_this4 = _super21.call(this);
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this4), "unit", void 0);
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this4), "bitWidth", void 0);
_this4.unit = unit;
_this4.bitWidth = bitWidth;
return _this4;
}
}
(0, _createClass2.default)(Time, [{
key: "typeId",
get: function get() {
return _enum.Type.Time;
}
}, {
key: "toString",
value: function toString() {
return "Time".concat(this.bitWidth, "<").concat(TimeUnit[this.unit], ">");
}
}, {
key: _Symbol$toStringTag4,
get: function get() {
return 'Time';
}
}]);
return Time;
}(DataType);
exports.Time = Time;
class TimeSecond extends Time {
constructor() {
super(TimeUnit.SECOND, 32);
var TimeSecond = function (_Time) {
(0, _inherits2.default)(TimeSecond, _Time);
var _super22 = _createSuper(TimeSecond);
function TimeSecond() {
(0, _classCallCheck2.default)(this, TimeSecond);
return _super22.call(this, TimeUnit.SECOND, 32);
}
}
return TimeSecond;
}(Time);
exports.TimeSecond = TimeSecond;
class TimeMillisecond extends Time {
constructor() {
super(TimeUnit.MILLISECOND, 32);
var TimeMillisecond = function (_Time2) {
(0, _inherits2.default)(TimeMillisecond, _Time2);
var _super23 = _createSuper(TimeMillisecond);
function TimeMillisecond() {
(0, _classCallCheck2.default)(this, TimeMillisecond);
return _super23.call(this, TimeUnit.MILLISECOND, 32);
}
}
return TimeMillisecond;
}(Time);

@@ -435,63 +671,105 @@ exports.TimeMillisecond = TimeMillisecond;

class Timestamp extends DataType {
constructor(unit, timezone = null) {
super();
(0, _defineProperty2.default)(this, "unit", void 0);
(0, _defineProperty2.default)(this, "timezone", void 0);
this.unit = unit;
this.timezone = timezone;
}
var Timestamp = function (_DataType9) {
(0, _inherits2.default)(Timestamp, _DataType9);
get typeId() {
return _enum.Type.Timestamp;
}
var _super24 = _createSuper(Timestamp);
get [_Symbol$toStringTag5]() {
return 'Timestamp';
}
function Timestamp(unit) {
var _this5;
toString() {
return "Timestamp<".concat(TimeUnit[this.unit]).concat(this.timezone ? ", ".concat(this.timezone) : '', ">");
var timezone = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
(0, _classCallCheck2.default)(this, Timestamp);
_this5 = _super24.call(this);
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this5), "unit", void 0);
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this5), "timezone", void 0);
_this5.unit = unit;
_this5.timezone = timezone;
return _this5;
}
}
(0, _createClass2.default)(Timestamp, [{
key: "typeId",
get: function get() {
return _enum.Type.Timestamp;
}
}, {
key: _Symbol$toStringTag5,
get: function get() {
return 'Timestamp';
}
}, {
key: "toString",
value: function toString() {
return "Timestamp<".concat(TimeUnit[this.unit]).concat(this.timezone ? ", ".concat(this.timezone) : '', ">");
}
}]);
return Timestamp;
}(DataType);
exports.Timestamp = Timestamp;
class TimestampSecond extends Timestamp {
constructor(timezone = null) {
super(TimeUnit.SECOND, timezone);
var TimestampSecond = function (_Timestamp) {
(0, _inherits2.default)(TimestampSecond, _Timestamp);
var _super25 = _createSuper(TimestampSecond);
function TimestampSecond() {
var timezone = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
(0, _classCallCheck2.default)(this, TimestampSecond);
return _super25.call(this, TimeUnit.SECOND, timezone);
}
}
return TimestampSecond;
}(Timestamp);
exports.TimestampSecond = TimestampSecond;
class TimestampMillisecond extends Timestamp {
constructor(timezone = null) {
super(TimeUnit.MILLISECOND, timezone);
var TimestampMillisecond = function (_Timestamp2) {
(0, _inherits2.default)(TimestampMillisecond, _Timestamp2);
var _super26 = _createSuper(TimestampMillisecond);
function TimestampMillisecond() {
var timezone = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
(0, _classCallCheck2.default)(this, TimestampMillisecond);
return _super26.call(this, TimeUnit.MILLISECOND, timezone);
}
}
return TimestampMillisecond;
}(Timestamp);
exports.TimestampMillisecond = TimestampMillisecond;
class TimestampMicrosecond extends Timestamp {
constructor(timezone = null) {
super(TimeUnit.MICROSECOND, timezone);
var TimestampMicrosecond = function (_Timestamp3) {
(0, _inherits2.default)(TimestampMicrosecond, _Timestamp3);
var _super27 = _createSuper(TimestampMicrosecond);
function TimestampMicrosecond() {
var timezone = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
(0, _classCallCheck2.default)(this, TimestampMicrosecond);
return _super27.call(this, TimeUnit.MICROSECOND, timezone);
}
}
return TimestampMicrosecond;
}(Timestamp);
exports.TimestampMicrosecond = TimestampMicrosecond;
class TimestampNanosecond extends Timestamp {
constructor(timezone = null) {
super(TimeUnit.NANOSECOND, timezone);
var TimestampNanosecond = function (_Timestamp4) {
(0, _inherits2.default)(TimestampNanosecond, _Timestamp4);
var _super28 = _createSuper(TimestampNanosecond);
function TimestampNanosecond() {
var timezone = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
(0, _classCallCheck2.default)(this, TimestampNanosecond);
return _super28.call(this, TimeUnit.NANOSECOND, timezone);
}
}
return TimestampNanosecond;
}(Timestamp);
exports.TimestampNanosecond = TimestampNanosecond;
const IntervalUnit = {
var IntervalUnit = {
DAY_TIME: 0,

@@ -502,40 +780,65 @@ YEAR_MONTH: 1

class Interval extends DataType {
constructor(unit) {
super();
(0, _defineProperty2.default)(this, "unit", void 0);
this.unit = unit;
}
var Interval = function (_DataType10) {
(0, _inherits2.default)(Interval, _DataType10);
get typeId() {
return _enum.Type.Interval;
}
var _super29 = _createSuper(Interval);
get [_Symbol$toStringTag6]() {
return 'Interval';
}
function Interval(unit) {
var _this6;
toString() {
return "Interval<".concat(IntervalUnit[this.unit], ">");
(0, _classCallCheck2.default)(this, Interval);
_this6 = _super29.call(this);
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this6), "unit", void 0);
_this6.unit = unit;
return _this6;
}
}
(0, _createClass2.default)(Interval, [{
key: "typeId",
get: function get() {
return _enum.Type.Interval;
}
}, {
key: _Symbol$toStringTag6,
get: function get() {
return 'Interval';
}
}, {
key: "toString",
value: function toString() {
return "Interval<".concat(IntervalUnit[this.unit], ">");
}
}]);
return Interval;
}(DataType);
exports.Interval = Interval;
class IntervalDayTime extends Interval {
constructor() {
super(IntervalUnit.DAY_TIME);
var IntervalDayTime = function (_Interval) {
(0, _inherits2.default)(IntervalDayTime, _Interval);
var _super30 = _createSuper(IntervalDayTime);
function IntervalDayTime() {
(0, _classCallCheck2.default)(this, IntervalDayTime);
return _super30.call(this, IntervalUnit.DAY_TIME);
}
}
return IntervalDayTime;
}(Interval);
exports.IntervalDayTime = IntervalDayTime;
class IntervalYearMonth extends Interval {
constructor() {
super(IntervalUnit.YEAR_MONTH);
var IntervalYearMonth = function (_Interval2) {
(0, _inherits2.default)(IntervalYearMonth, _Interval2);
var _super31 = _createSuper(IntervalYearMonth);
function IntervalYearMonth() {
(0, _classCallCheck2.default)(this, IntervalYearMonth);
return _super31.call(this, IntervalUnit.YEAR_MONTH);
}
}
return IntervalYearMonth;
}(Interval);

@@ -545,58 +848,88 @@ exports.IntervalYearMonth = IntervalYearMonth;

class FixedSizeList extends DataType {
constructor(listSize, child) {
super();
(0, _defineProperty2.default)(this, "listSize", void 0);
(0, _defineProperty2.default)(this, "children", void 0);
this.listSize = listSize;
this.children = [child];
}
var FixedSizeList = function (_DataType11) {
(0, _inherits2.default)(FixedSizeList, _DataType11);
get typeId() {
return _enum.Type.FixedSizeList;
}
var _super32 = _createSuper(FixedSizeList);
get valueType() {
return this.children[0].type;
}
function FixedSizeList(listSize, child) {
var _this7;
get valueField() {
return this.children[0];
(0, _classCallCheck2.default)(this, FixedSizeList);
_this7 = _super32.call(this);
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this7), "listSize", void 0);
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this7), "children", void 0);
_this7.listSize = listSize;
_this7.children = [child];
return _this7;
}
get [_Symbol$toStringTag7]() {
return 'FixedSizeList';
}
(0, _createClass2.default)(FixedSizeList, [{
key: "typeId",
get: function get() {
return _enum.Type.FixedSizeList;
}
}, {
key: "valueType",
get: function get() {
return this.children[0].type;
}
}, {
key: "valueField",
get: function get() {
return this.children[0];
}
}, {
key: _Symbol$toStringTag7,
get: function get() {
return 'FixedSizeList';
}
}, {
key: "toString",
value: function toString() {
return "FixedSizeList[".concat(this.listSize, "]<").concat(this.valueType, ">");
}
}]);
return FixedSizeList;
}(DataType);
toString() {
return "FixedSizeList[".concat(this.listSize, "]<").concat(this.valueType, ">");
}
}
exports.FixedSizeList = FixedSizeList;
_Symbol$toStringTag8 = Symbol.toStringTag;
class Struct extends DataType {
constructor(children) {
super();
(0, _defineProperty2.default)(this, "children", void 0);
this.children = children;
}
var Struct = function (_DataType12) {
(0, _inherits2.default)(Struct, _DataType12);
get typeId() {
return _enum.Type.Struct;
}
var _super33 = _createSuper(Struct);
toString() {
return "Struct<{".concat(this.children.map(f => "".concat(f.name, ":").concat(f.type)).join(', '), "}>");
}
function Struct(children) {
var _this8;
get [_Symbol$toStringTag8]() {
return 'Struct';
(0, _classCallCheck2.default)(this, Struct);
_this8 = _super33.call(this);
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this8), "children", void 0);
_this8.children = children;
return _this8;
}
}
(0, _createClass2.default)(Struct, [{
key: "typeId",
get: function get() {
return _enum.Type.Struct;
}
}, {
key: "toString",
value: function toString() {
return "Struct<{".concat(this.children.map(function (f) {
return "".concat(f.name, ":").concat(f.type);
}).join(', '), "}>");
}
}, {
key: _Symbol$toStringTag8,
get: function get() {
return 'Struct';
}
}]);
return Struct;
}(DataType);
exports.Struct = Struct;
//# sourceMappingURL=type.js.map

@@ -10,3 +10,3 @@ "use strict";

enumerable: true,
get: function () {
get: function get() {
return _schema.default;

@@ -17,3 +17,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _field.default;

@@ -24,3 +24,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _type.Type;

@@ -31,3 +31,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _type.DataType;

@@ -38,3 +38,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _type.Null;

@@ -45,3 +45,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _type.Bool;

@@ -52,3 +52,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _type.Int;

@@ -59,3 +59,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _type.Int8;

@@ -66,3 +66,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _type.Int16;

@@ -73,3 +73,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _type.Int32;

@@ -80,3 +80,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _type.Int64;

@@ -87,3 +87,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _type.Uint8;

@@ -94,3 +94,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _type.Uint16;

@@ -101,3 +101,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _type.Uint32;

@@ -108,3 +108,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _type.Uint64;

@@ -115,3 +115,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _type.Float;

@@ -122,3 +122,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _type.Float16;

@@ -129,3 +129,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _type.Float32;

@@ -136,3 +136,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _type.Float64;

@@ -143,3 +143,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _type.Binary;

@@ -150,3 +150,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _type.Utf8;

@@ -157,3 +157,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _type.Date;

@@ -164,3 +164,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _type.DateDay;

@@ -171,3 +171,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _type.DateMillisecond;

@@ -178,3 +178,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _type.Time;

@@ -185,3 +185,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _type.TimeSecond;

@@ -192,3 +192,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _type.TimeMillisecond;

@@ -199,3 +199,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _type.Timestamp;

@@ -206,3 +206,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _type.TimestampSecond;

@@ -213,3 +213,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _type.TimestampMillisecond;

@@ -220,3 +220,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _type.TimestampMicrosecond;

@@ -227,3 +227,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _type.TimestampNanosecond;

@@ -234,3 +234,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _type.Interval;

@@ -241,3 +241,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _type.IntervalDayTime;

@@ -248,3 +248,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _type.IntervalYearMonth;

@@ -255,3 +255,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _type.FixedSizeList;

@@ -262,3 +262,3 @@ }

enumerable: true,
get: function () {
get: function get() {
return _type.Struct;

@@ -265,0 +265,0 @@ }

@@ -11,21 +11,55 @@ "use strict";

var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
let _Symbol$asyncIterator;
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
class ArrayQueue extends Array {
enqueue(value) {
return this.push(value);
}
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
dequeue() {
return this.shift();
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
var _wrapNativeSuper2 = _interopRequireDefault(require("@babel/runtime/helpers/wrapNativeSuper"));
var _Symbol$asyncIterator;
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
var ArrayQueue = function (_Array) {
(0, _inherits2.default)(ArrayQueue, _Array);
var _super = _createSuper(ArrayQueue);
function ArrayQueue() {
(0, _classCallCheck2.default)(this, ArrayQueue);
return _super.apply(this, arguments);
}
}
(0, _createClass2.default)(ArrayQueue, [{
key: "enqueue",
value: function enqueue(value) {
return this.push(value);
}
}, {
key: "dequeue",
value: function dequeue() {
return this.shift();
}
}]);
return ArrayQueue;
}((0, _wrapNativeSuper2.default)(Array));
_Symbol$asyncIterator = Symbol.asyncIterator;
class AsyncQueue {
constructor() {
var AsyncQueue = function () {
function AsyncQueue() {
(0, _classCallCheck2.default)(this, AsyncQueue);
(0, _defineProperty2.default)(this, "_values", void 0);

@@ -39,94 +73,143 @@ (0, _defineProperty2.default)(this, "_settlers", void 0);

close() {
while (this._settlers.length > 0) {
this._settlers.dequeue().resolve({
done: true
});
(0, _createClass2.default)(AsyncQueue, [{
key: "close",
value: function close() {
while (this._settlers.length > 0) {
this._settlers.dequeue().resolve({
done: true
});
}
this._closed = true;
}
}, {
key: _Symbol$asyncIterator,
value: function value() {
return this;
}
}, {
key: "enqueue",
value: function enqueue(value) {
if (this._closed) {
throw new Error('Closed');
}
this._closed = true;
}
if (this._settlers.length > 0) {
if (this._values.length > 0) {
throw new Error('Illegal internal state');
}
[_Symbol$asyncIterator]() {
return this;
}
var settler = this._settlers.dequeue();
enqueue(value) {
if (this._closed) {
throw new Error('Closed');
if (value instanceof Error) {
settler.reject(value);
} else {
settler.resolve({
value: value
});
}
} else {
this._values.enqueue(value);
}
}
}, {
key: "next",
value: function next() {
var _this = this;
if (this._settlers.length > 0) {
if (this._values.length > 0) {
throw new Error('Illegal internal state');
}
var _value = this._values.dequeue();
const settler = this._settlers.dequeue();
if (_value instanceof Error) {
return Promise.reject(_value);
}
if (value instanceof Error) {
settler.reject(value);
} else {
settler.resolve({
value
return Promise.resolve({
value: _value
});
}
} else {
this._values.enqueue(value);
}
}
next() {
if (this._values.length > 0) {
const value = this._values.dequeue();
if (this._closed) {
if (this._settlers.length > 0) {
throw new Error('Illegal internal state');
}
if (value instanceof Error) {
return Promise.reject(value);
return Promise.resolve({
done: true
});
}
return Promise.resolve({
value
return new Promise(function (resolve, reject) {
_this._settlers.enqueue({
resolve: resolve,
reject: reject
});
});
}
}]);
return AsyncQueue;
}();
if (this._closed) {
if (this._settlers.length > 0) {
throw new Error('Illegal internal state');
}
exports.default = AsyncQueue;
return Promise.resolve({
done: true
});
}
function takeAsync(_x) {
return _takeAsync.apply(this, arguments);
}
return new Promise((resolve, reject) => {
this._settlers.enqueue({
resolve,
reject
});
});
}
function _takeAsync() {
_takeAsync = (0, _asyncToGenerator2.default)(_regenerator.default.mark(function _callee(asyncIterable) {
var count,
result,
iterator,
_yield$iterator$next,
_value2,
done,
_args = arguments;
}
return _regenerator.default.wrap(function _callee$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
count = _args.length > 1 && _args[1] !== undefined ? _args[1] : Infinity;
result = [];
iterator = asyncIterable[Symbol.asyncIterator]();
exports.default = AsyncQueue;
case 3:
if (!(result.length < count)) {
_context.next = 14;
break;
}
async function takeAsync(asyncIterable, count = Infinity) {
const result = [];
const iterator = asyncIterable[Symbol.asyncIterator]();
_context.next = 6;
return iterator.next();
while (result.length < count) {
const {
value,
done
} = await iterator.next();
case 6:
_yield$iterator$next = _context.sent;
_value2 = _yield$iterator$next.value;
done = _yield$iterator$next.done;
if (done) {
break;
}
if (!done) {
_context.next = 11;
break;
}
result.push(value);
}
return _context.abrupt("break", 14);
return result;
case 11:
result.push(_value2);
_context.next = 3;
break;
case 14:
return _context.abrupt("return", result);
case 15:
case "end":
return _context.stop();
}
}
}, _callee);
}));
return _takeAsync.apply(this, arguments);
}
//# sourceMappingURL=async-queue.js.map

@@ -18,5 +18,5 @@ "use strict";

const objectRow = {};
var objectRow = {};
for (let i = 0; i < headers.length; i++) {
for (var i = 0; i < headers.length; i++) {
objectRow[headers[i]] = arrayRow[i];

@@ -37,5 +37,5 @@ }

const arrayRow = new Array(headers.length);
var arrayRow = new Array(headers.length);
for (let i = 0; i < headers.length; i++) {
for (var i = 0; i < headers.length; i++) {
arrayRow[i] = objectRow[headers[i]];

@@ -42,0 +42,0 @@ }

{
"name": "@loaders.gl/schema",
"version": "3.1.0-beta.7",
"version": "3.1.0",
"description": "Table format APIs for JSON, CSV, etc...",

@@ -37,3 +37,3 @@ "license": "MIT",

},
"gitHead": "f3b4d81ac02758398c4e4eef5e556b206ef2dfbe"
"gitHead": "b02a011b5a6d6aa6c5870819045c70db168cb930"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc