@loaders.gl/schema 4.0.0-alpha.4 → 4.0.0-alpha.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle.d.ts +2 -0
- package/dist/bundle.d.ts.map +1 -0
- package/dist/bundle.js +2 -2
- package/dist/dist.min.js +13589 -0
- package/dist/es5/bundle.js +6 -0
- package/dist/es5/bundle.js.map +1 -0
- package/dist/es5/index.js +406 -0
- package/dist/es5/index.js.map +1 -0
- package/dist/es5/lib/mesh/convert-mesh.js +34 -0
- package/dist/es5/lib/mesh/convert-mesh.js.map +1 -0
- package/dist/es5/lib/mesh/deduce-mesh-schema.js +56 -0
- package/dist/es5/lib/mesh/deduce-mesh-schema.js.map +1 -0
- package/dist/es5/lib/mesh/mesh-to-arrow-table.js +2 -0
- package/dist/es5/lib/mesh/mesh-to-arrow-table.js.map +1 -0
- package/dist/es5/lib/mesh/mesh-utils.js +40 -0
- package/dist/es5/lib/mesh/mesh-utils.js.map +1 -0
- package/dist/es5/lib/table/arrow/arrow-type-utils.js +30 -0
- package/dist/es5/lib/table/arrow/arrow-type-utils.js.map +1 -0
- package/dist/es5/lib/table/arrow/convert-schema-arrow.js +179 -0
- package/dist/es5/lib/table/arrow/convert-schema-arrow.js.map +1 -0
- package/dist/es5/lib/table/arrow/convert-table-to-arrow.js +2 -0
- package/dist/es5/lib/table/arrow/convert-table-to-arrow.js.map +1 -0
- package/dist/es5/lib/table/arrow-api/arrow-like-field.js +49 -0
- package/dist/es5/lib/table/arrow-api/arrow-like-field.js.map +1 -0
- package/dist/es5/lib/table/arrow-api/arrow-like-schema.js +118 -0
- package/dist/es5/lib/table/arrow-api/arrow-like-schema.js.map +1 -0
- package/dist/es5/lib/table/arrow-api/arrow-like-table.js +80 -0
- package/dist/es5/lib/table/arrow-api/arrow-like-table.js.map +1 -0
- package/dist/es5/lib/table/arrow-api/arrow-like-type.js +740 -0
- package/dist/es5/lib/table/arrow-api/arrow-like-type.js.map +1 -0
- package/dist/es5/lib/table/arrow-api/enum.js +55 -0
- package/dist/es5/lib/table/arrow-api/enum.js.map +1 -0
- package/dist/es5/lib/table/arrow-api/get-type-info.js +27 -0
- package/dist/es5/lib/table/arrow-api/get-type-info.js.map +1 -0
- package/dist/es5/lib/table/arrow-api/index.js +44 -0
- package/dist/es5/lib/table/arrow-api/index.js.map +1 -0
- package/dist/es5/lib/table/batches/base-table-batch-aggregator.js +78 -0
- package/dist/es5/lib/table/batches/base-table-batch-aggregator.js.map +1 -0
- package/dist/es5/lib/table/batches/columnar-table-batch-aggregator.js +106 -0
- package/dist/es5/lib/table/batches/columnar-table-batch-aggregator.js.map +1 -0
- package/dist/es5/lib/table/batches/row-table-batch-aggregator.js +96 -0
- package/dist/es5/lib/table/batches/row-table-batch-aggregator.js.map +1 -0
- package/dist/es5/lib/table/batches/table-batch-aggregator.js +2 -0
- package/dist/es5/lib/table/batches/table-batch-aggregator.js.map +1 -0
- package/dist/es5/lib/table/batches/table-batch-builder.js +173 -0
- package/dist/es5/lib/table/batches/table-batch-builder.js.map +1 -0
- package/dist/es5/lib/table/simple-table/convert-table.js +82 -0
- package/dist/es5/lib/table/simple-table/convert-table.js.map +1 -0
- package/dist/es5/lib/table/simple-table/data-type.js +94 -0
- package/dist/es5/lib/table/simple-table/data-type.js.map +1 -0
- package/dist/es5/lib/table/simple-table/make-table.js +60 -0
- package/dist/es5/lib/table/simple-table/make-table.js.map +1 -0
- package/dist/es5/lib/table/simple-table/row-utils.js +34 -0
- package/dist/es5/lib/table/simple-table/row-utils.js.map +1 -0
- package/dist/es5/lib/table/simple-table/table-accessors.js +343 -0
- package/dist/es5/lib/table/simple-table/table-accessors.js.map +1 -0
- package/dist/es5/lib/table/simple-table/table-column.js +12 -0
- package/dist/es5/lib/table/simple-table/table-column.js.map +1 -0
- package/dist/es5/lib/table/simple-table/table-schema.js +85 -0
- package/dist/es5/lib/table/simple-table/table-schema.js.map +1 -0
- package/dist/es5/lib/utils/assert.js +12 -0
- package/dist/es5/lib/utils/assert.js.map +1 -0
- package/dist/es5/lib/utils/async-queue.js +169 -0
- package/dist/es5/lib/utils/async-queue.js.map +1 -0
- package/dist/es5/types/category-gis.js +2 -0
- package/dist/es5/types/category-gis.js.map +1 -0
- package/dist/es5/types/category-image.js +2 -0
- package/dist/es5/types/category-image.js.map +1 -0
- package/dist/es5/types/category-mesh.js +2 -0
- package/dist/es5/types/category-mesh.js.map +1 -0
- package/dist/es5/types/category-table.js +2 -0
- package/dist/es5/types/category-table.js.map +1 -0
- package/dist/es5/types/category-texture.js +2 -0
- package/dist/es5/types/category-texture.js.map +1 -0
- package/dist/es5/types/schema.js +2 -0
- package/dist/es5/types/schema.js.map +1 -0
- package/dist/es5/types/types.js +2 -0
- package/dist/es5/types/types.js.map +1 -0
- package/dist/esm/bundle.js +4 -0
- package/dist/esm/bundle.js.map +1 -0
- package/dist/esm/index.js +16 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/{category → esm/lib}/mesh/convert-mesh.js +0 -11
- package/dist/esm/lib/mesh/convert-mesh.js.map +1 -0
- package/dist/esm/lib/mesh/deduce-mesh-schema.js +48 -0
- package/dist/esm/lib/mesh/deduce-mesh-schema.js.map +1 -0
- package/dist/esm/lib/mesh/mesh-to-arrow-table.js +2 -0
- package/dist/esm/lib/mesh/mesh-to-arrow-table.js.map +1 -0
- package/dist/{category → esm/lib}/mesh/mesh-utils.js +0 -5
- package/dist/esm/lib/mesh/mesh-utils.js.map +1 -0
- package/dist/{lib/arrow/arrow-like-type-utils.js → esm/lib/table/arrow/arrow-type-utils.js} +3 -11
- package/dist/esm/lib/table/arrow/arrow-type-utils.js.map +1 -0
- package/dist/esm/lib/table/arrow/convert-schema-arrow.js +158 -0
- package/dist/esm/lib/table/arrow/convert-schema-arrow.js.map +1 -0
- package/dist/esm/lib/table/arrow/convert-table-to-arrow.js +2 -0
- package/dist/esm/lib/table/arrow/convert-table-to-arrow.js.map +1 -0
- package/dist/{lib/schema/impl/field.js → esm/lib/table/arrow-api/arrow-like-field.js} +6 -13
- package/dist/esm/lib/table/arrow-api/arrow-like-field.js.map +1 -0
- package/dist/{lib/schema/impl/schema.js → esm/lib/table/arrow-api/arrow-like-schema.js} +22 -47
- package/dist/esm/lib/table/arrow-api/arrow-like-schema.js.map +1 -0
- package/dist/esm/lib/table/arrow-api/arrow-like-table.js +51 -0
- package/dist/esm/lib/table/arrow-api/arrow-like-table.js.map +1 -0
- package/dist/{lib/schema/impl/type.js → esm/lib/table/arrow-api/arrow-like-type.js} +11 -116
- package/dist/esm/lib/table/arrow-api/arrow-like-type.js.map +1 -0
- package/dist/{lib/schema/impl → esm/lib/table/arrow-api}/enum.js +3 -4
- package/dist/esm/lib/table/arrow-api/enum.js.map +1 -0
- package/dist/{lib/arrow → esm/lib/table/arrow-api}/get-type-info.js +1 -4
- package/dist/esm/lib/table/arrow-api/get-type-info.js.map +1 -0
- package/dist/esm/lib/table/arrow-api/index.js +5 -0
- package/dist/esm/lib/table/arrow-api/index.js.map +1 -0
- package/dist/{lib → esm/lib/table}/batches/base-table-batch-aggregator.js +1 -18
- package/dist/esm/lib/table/batches/base-table-batch-aggregator.js.map +1 -0
- package/dist/{lib → esm/lib/table}/batches/columnar-table-batch-aggregator.js +1 -24
- package/dist/esm/lib/table/batches/columnar-table-batch-aggregator.js.map +1 -0
- package/dist/{lib → esm/lib/table}/batches/row-table-batch-aggregator.js +2 -22
- package/dist/esm/lib/table/batches/row-table-batch-aggregator.js.map +1 -0
- package/dist/esm/lib/table/batches/table-batch-aggregator.js.map +1 -0
- package/dist/{lib → esm/lib/table}/batches/table-batch-builder.js +6 -49
- package/dist/esm/lib/table/batches/table-batch-builder.js.map +1 -0
- package/dist/esm/lib/table/simple-table/convert-table.js +59 -0
- package/dist/esm/lib/table/simple-table/convert-table.js.map +1 -0
- package/dist/esm/lib/table/simple-table/data-type.js +85 -0
- package/dist/esm/lib/table/simple-table/data-type.js.map +1 -0
- package/dist/esm/lib/table/simple-table/make-table.js +50 -0
- package/dist/esm/lib/table/simple-table/make-table.js.map +1 -0
- package/dist/{lib/utils → esm/lib/table/simple-table}/row-utils.js +0 -8
- package/dist/esm/lib/table/simple-table/row-utils.js.map +1 -0
- package/dist/esm/lib/table/simple-table/table-accessors.js +262 -0
- package/dist/esm/lib/table/simple-table/table-accessors.js.map +1 -0
- package/dist/esm/lib/table/simple-table/table-column.js +6 -0
- package/dist/esm/lib/table/simple-table/table-column.js.map +1 -0
- package/dist/esm/lib/table/simple-table/table-schema.js +70 -0
- package/dist/esm/lib/table/simple-table/table-schema.js.map +1 -0
- package/dist/esm/lib/utils/assert.js +6 -0
- package/dist/esm/lib/utils/assert.js.map +1 -0
- package/dist/esm/lib/utils/async-queue.js +94 -0
- package/dist/esm/lib/utils/async-queue.js.map +1 -0
- package/dist/esm/types/category-gis.js +2 -0
- package/dist/esm/types/category-gis.js.map +1 -0
- package/dist/esm/types/category-image.js +2 -0
- package/dist/esm/types/category-image.js.map +1 -0
- package/dist/esm/types/category-mesh.js +2 -0
- package/dist/esm/types/category-mesh.js.map +1 -0
- package/dist/esm/types/category-table.js +2 -0
- package/dist/esm/types/category-table.js.map +1 -0
- package/dist/esm/types/category-texture.js +2 -0
- package/dist/esm/types/category-texture.js.map +1 -0
- package/dist/esm/types/schema.js +2 -0
- package/dist/esm/types/schema.js.map +1 -0
- package/dist/esm/types/types.js.map +1 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +92 -13
- package/dist/lib/mesh/convert-mesh.d.ts +15 -0
- package/dist/lib/mesh/convert-mesh.d.ts.map +1 -0
- package/dist/lib/mesh/convert-mesh.js +40 -0
- package/dist/lib/mesh/deduce-mesh-schema.d.ts +24 -0
- package/dist/lib/mesh/deduce-mesh-schema.d.ts.map +1 -0
- package/dist/lib/mesh/deduce-mesh-schema.js +66 -0
- package/dist/lib/mesh/mesh-to-arrow-table.d.ts +1 -0
- package/dist/lib/mesh/mesh-to-arrow-table.d.ts.map +1 -0
- package/dist/lib/mesh/mesh-to-arrow-table.js +44 -0
- package/dist/lib/mesh/mesh-utils.d.ts +23 -0
- package/dist/lib/mesh/mesh-utils.d.ts.map +1 -0
- package/dist/lib/mesh/mesh-utils.js +51 -0
- package/dist/lib/table/arrow/arrow-type-utils.d.ts +4 -0
- package/dist/lib/table/arrow/arrow-type-utils.d.ts.map +1 -0
- package/dist/lib/table/arrow/arrow-type-utils.js +53 -0
- package/dist/lib/table/arrow/convert-schema-arrow.d.ts +13 -0
- package/dist/lib/table/arrow/convert-schema-arrow.d.ts.map +1 -0
- package/dist/lib/table/arrow/convert-schema-arrow.js +187 -0
- package/dist/lib/table/arrow/convert-table-to-arrow.d.ts +42 -0
- package/dist/lib/table/arrow/convert-table-to-arrow.d.ts.map +1 -0
- package/dist/lib/table/arrow/convert-table-to-arrow.js +57 -0
- package/dist/lib/table/arrow-api/arrow-like-field.d.ts +19 -0
- package/dist/lib/table/arrow-api/arrow-like-field.d.ts.map +1 -0
- package/dist/lib/table/arrow-api/arrow-like-field.js +34 -0
- package/dist/lib/table/arrow-api/arrow-like-schema.d.ts +12 -0
- package/dist/lib/table/arrow-api/arrow-like-schema.d.ts.map +1 -0
- package/dist/lib/table/arrow-api/arrow-like-schema.js +81 -0
- package/dist/lib/table/arrow-api/arrow-like-table.d.ts +28 -0
- package/dist/lib/table/arrow-api/arrow-like-table.d.ts.map +1 -0
- package/dist/lib/table/arrow-api/arrow-like-table.js +53 -0
- package/dist/lib/table/arrow-api/arrow-like-type.d.ts +177 -0
- package/dist/lib/table/arrow-api/arrow-like-type.d.ts.map +1 -0
- package/dist/lib/table/arrow-api/arrow-like-type.js +463 -0
- package/dist/lib/table/arrow-api/enum.d.ts +92 -0
- package/dist/lib/table/arrow-api/enum.d.ts.map +1 -0
- package/dist/lib/table/arrow-api/enum.js +97 -0
- package/dist/lib/table/arrow-api/get-type-info.d.ts +13 -0
- package/dist/lib/table/arrow-api/get-type-info.d.ts.map +1 -0
- package/dist/lib/table/arrow-api/get-type-info.js +29 -0
- package/dist/lib/table/arrow-api/index.d.ts +5 -0
- package/dist/lib/table/arrow-api/index.d.ts.map +1 -0
- package/dist/lib/table/arrow-api/index.js +25 -0
- package/dist/lib/table/batches/base-table-batch-aggregator.d.ts +19 -0
- package/dist/lib/table/batches/base-table-batch-aggregator.d.ts.map +1 -0
- package/dist/lib/table/batches/base-table-batch-aggregator.js +60 -0
- package/dist/lib/table/batches/columnar-table-batch-aggregator.d.ts +23 -0
- package/dist/lib/table/batches/columnar-table-batch-aggregator.d.ts.map +1 -0
- package/dist/lib/table/batches/columnar-table-batch-aggregator.js +92 -0
- package/dist/lib/table/batches/row-table-batch-aggregator.d.ts +22 -0
- package/dist/lib/table/batches/row-table-batch-aggregator.d.ts.map +1 -0
- package/dist/lib/table/batches/row-table-batch-aggregator.js +81 -0
- package/dist/lib/table/batches/table-batch-aggregator.d.ts +25 -0
- package/dist/lib/table/batches/table-batch-aggregator.d.ts.map +1 -0
- package/dist/lib/table/batches/table-batch-aggregator.js +3 -0
- package/dist/lib/table/batches/table-batch-builder.d.ts +53 -0
- package/dist/lib/table/batches/table-batch-builder.d.ts.map +1 -0
- package/dist/lib/table/batches/table-batch-builder.js +152 -0
- package/dist/lib/table/simple-table/convert-table.d.ts +8 -0
- package/dist/lib/table/simple-table/convert-table.d.ts.map +1 -0
- package/dist/lib/table/simple-table/convert-table.js +65 -0
- package/dist/lib/table/simple-table/data-type.d.ts +17 -0
- package/dist/lib/table/simple-table/data-type.d.ts.map +1 -0
- package/dist/lib/table/simple-table/data-type.js +93 -0
- package/dist/lib/table/simple-table/make-table.d.ts +65 -0
- package/dist/lib/table/simple-table/make-table.d.ts.map +1 -0
- package/dist/lib/table/simple-table/make-table.js +95 -0
- package/dist/lib/table/simple-table/row-utils.d.ts +9 -0
- package/dist/lib/table/simple-table/row-utils.d.ts.map +1 -0
- package/dist/lib/table/simple-table/row-utils.js +33 -0
- package/dist/lib/table/simple-table/table-accessors.d.ts +67 -0
- package/dist/lib/table/simple-table/table-accessors.d.ts.map +1 -0
- package/dist/lib/table/simple-table/table-accessors.js +319 -0
- package/dist/lib/table/simple-table/table-column.d.ts +7 -0
- package/dist/lib/table/simple-table/table-column.d.ts.map +1 -0
- package/dist/lib/table/simple-table/table-column.js +41 -0
- package/dist/lib/table/simple-table/table-schema.d.ts +15 -0
- package/dist/lib/table/simple-table/table-schema.d.ts.map +1 -0
- package/dist/lib/table/simple-table/table-schema.js +85 -0
- package/dist/lib/utils/assert.d.ts +2 -0
- package/dist/lib/utils/assert.d.ts.map +1 -0
- package/dist/lib/utils/assert.js +11 -5
- package/dist/lib/utils/async-queue.d.ts +18 -0
- package/dist/lib/utils/async-queue.d.ts.map +1 -0
- package/dist/lib/utils/async-queue.js +82 -109
- package/dist/types/category-gis.d.ts +99 -0
- package/dist/types/category-gis.d.ts.map +1 -0
- package/dist/types/category-gis.js +2 -0
- package/dist/types/category-image.d.ts +18 -0
- package/dist/types/category-image.d.ts.map +1 -0
- package/dist/types/category-image.js +2 -0
- package/dist/types/category-mesh.d.ts +48 -0
- package/dist/types/category-mesh.d.ts.map +1 -0
- package/dist/types/category-mesh.js +3 -0
- package/dist/types/category-table.d.ts +86 -0
- package/dist/types/category-table.d.ts.map +1 -0
- package/dist/types/category-table.js +3 -0
- package/dist/types/category-texture.d.ts +18 -0
- package/dist/types/category-texture.d.ts.map +1 -0
- package/dist/types/category-texture.js +3 -0
- package/dist/types/schema.d.ts +77 -0
- package/dist/types/schema.d.ts.map +1 -0
- package/dist/types/schema.js +3 -0
- package/dist/types/types.d.ts +15 -0
- package/dist/types/types.d.ts.map +1 -0
- package/dist/types/types.js +2 -0
- package/package.json +7 -8
- package/src/index.ts +82 -29
- package/src/{category → lib}/mesh/convert-mesh.ts +10 -8
- package/src/{category → lib}/mesh/deduce-mesh-schema.ts +20 -19
- package/src/{category → lib}/mesh/mesh-to-arrow-table.ts +5 -3
- package/src/{category → lib}/mesh/mesh-utils.ts +2 -2
- package/src/lib/{arrow → table/arrow}/arrow-type-utils.ts +16 -12
- package/src/lib/table/arrow/convert-schema-arrow.ts +232 -0
- package/src/lib/table/arrow/convert-table-to-arrow.ts +59 -0
- package/src/lib/{schema/impl/field.ts → table/arrow-api/arrow-like-field.ts} +6 -4
- package/src/lib/table/arrow-api/arrow-like-schema.ts +99 -0
- package/src/lib/table/arrow-api/arrow-like-table.ts +83 -0
- package/src/lib/{schema/impl/type.ts → table/arrow-api/arrow-like-type.ts} +2 -1
- package/src/lib/{arrow → table/arrow-api}/get-type-info.ts +4 -3
- package/src/lib/table/arrow-api/index.ts +6 -0
- package/src/lib/{batches → table/batches}/base-table-batch-aggregator.ts +5 -3
- package/src/lib/{batches → table/batches}/columnar-table-batch-aggregator.ts +5 -3
- package/src/lib/{batches → table/batches}/row-table-batch-aggregator.ts +6 -4
- package/src/lib/{batches → table/batches}/table-batch-aggregator.ts +4 -2
- package/src/lib/{batches → table/batches}/table-batch-builder.ts +8 -6
- package/src/lib/table/simple-table/convert-table.ts +72 -0
- package/src/lib/table/simple-table/data-type.ts +102 -0
- package/src/lib/table/simple-table/make-table.ts +108 -0
- package/src/lib/table/simple-table/table-accessors.ts +360 -0
- package/src/lib/table/simple-table/table-column.ts +47 -0
- package/src/lib/table/simple-table/table-schema.ts +97 -0
- package/src/types/category-gis.ts +136 -0
- package/src/types/category-image.ts +19 -0
- package/src/{category/mesh/mesh-types.ts → types/category-mesh.ts} +6 -4
- package/src/types/category-table.ts +104 -0
- package/src/types/category-texture.ts +30 -0
- package/src/types/schema.ts +97 -0
- package/src/types/types.ts +43 -0
- package/dist/bundle.js.map +0 -1
- package/dist/category/common.js +0 -2
- package/dist/category/common.js.map +0 -1
- package/dist/category/gis.js +0 -2
- package/dist/category/gis.js.map +0 -1
- package/dist/category/mesh/convert-mesh.js.map +0 -1
- package/dist/category/mesh/deduce-mesh-schema.js +0 -42
- package/dist/category/mesh/deduce-mesh-schema.js.map +0 -1
- package/dist/category/mesh/mesh-to-arrow-table.js +0 -31
- package/dist/category/mesh/mesh-to-arrow-table.js.map +0 -1
- package/dist/category/mesh/mesh-types.js +0 -2
- package/dist/category/mesh/mesh-types.js.map +0 -1
- package/dist/category/mesh/mesh-utils.js.map +0 -1
- package/dist/category/table/deduce-table-schema.js +0 -51
- package/dist/category/table/deduce-table-schema.js.map +0 -1
- package/dist/category/table/table-types.js +0 -2
- package/dist/category/table/table-types.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/lib/arrow/arrow-like-type-utils.js.map +0 -1
- package/dist/lib/arrow/arrow-type-utils.js +0 -62
- package/dist/lib/arrow/arrow-type-utils.js.map +0 -1
- package/dist/lib/arrow/get-type-info.js.map +0 -1
- package/dist/lib/batches/base-table-batch-aggregator.js.map +0 -1
- package/dist/lib/batches/columnar-table-batch-aggregator.js.map +0 -1
- package/dist/lib/batches/row-table-batch-aggregator.js.map +0 -1
- package/dist/lib/batches/table-batch-aggregator.js.map +0 -1
- package/dist/lib/batches/table-batch-builder.js.map +0 -1
- package/dist/lib/schema/impl/enum.js.map +0 -1
- package/dist/lib/schema/impl/field.js.map +0 -1
- package/dist/lib/schema/impl/schema.js.map +0 -1
- package/dist/lib/schema/impl/type.js.map +0 -1
- package/dist/lib/schema/index.js +0 -5
- package/dist/lib/schema/index.js.map +0 -1
- package/dist/lib/schema-utils/deduce-column-type.js +0 -23
- package/dist/lib/schema-utils/deduce-column-type.js.map +0 -1
- package/dist/lib/utils/assert.js.map +0 -1
- package/dist/lib/utils/async-queue.js.map +0 -1
- package/dist/lib/utils/row-utils.js.map +0 -1
- package/dist/types.js.map +0 -1
- package/src/category/common.ts +0 -30
- package/src/category/gis.ts +0 -61
- package/src/category/table/deduce-table-schema.ts +0 -123
- package/src/category/table/table-types.ts +0 -81
- package/src/lib/arrow/arrow-like-type-utils.ts +0 -25
- package/src/lib/schema/impl/schema.ts +0 -99
- package/src/lib/schema/index.ts +0 -82
- package/src/lib/schema-utils/deduce-column-type.ts +0 -92
- package/src/types.ts +0 -19
- /package/dist/{lib → esm/lib/table}/batches/table-batch-aggregator.js +0 -0
- /package/dist/{types.js → esm/types/types.js} +0 -0
- /package/src/lib/{schema/impl → table/arrow-api}/enum.ts +0 -0
- /package/src/lib/{utils → table/simple-table}/row-utils.ts +0 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Main data type enumeration.
|
|
3
|
+
*
|
|
4
|
+
* Data types in this library are all *logical*. They can be expressed as
|
|
5
|
+
* either a primitive physical type (bytes or bits of some fixed size), a
|
|
6
|
+
* nested type consisting of other data types, or another data type (e.g. a
|
|
7
|
+
* timestamp encoded as an int64).
|
|
8
|
+
*
|
|
9
|
+
* **Note**: Only enum values 0-17 (NONE through Map) are written to an Arrow
|
|
10
|
+
* IPC payload.
|
|
11
|
+
*
|
|
12
|
+
* The rest of the values are specified here so TypeScript can narrow the type
|
|
13
|
+
* signatures further beyond the base Arrow Types. The Arrow DataTypes include
|
|
14
|
+
* metadata like `bitWidth` that impact the type signatures of the values we
|
|
15
|
+
* accept and return.
|
|
16
|
+
*
|
|
17
|
+
* For example, the `Int8Vector` reads 1-byte numbers from an `Int8Array`, an
|
|
18
|
+
* `Int32Vector` reads a 4-byte number from an `Int32Array`, and an `Int64Vector`
|
|
19
|
+
* reads a pair of 4-byte lo, hi 32-bit integers as a zero-copy slice from the
|
|
20
|
+
* underlying `Int32Array`.
|
|
21
|
+
*
|
|
22
|
+
* Library consumers benefit by knowing the narrowest type, since we can ensure
|
|
23
|
+
* the types across all public methods are propagated, and never bail to `any`.
|
|
24
|
+
* These values are _never_ used at runtime, and they will _never_ be written
|
|
25
|
+
* to the flatbuffers metadata of serialized Arrow IPC payloads.
|
|
26
|
+
*/
|
|
27
|
+
export declare enum Type {
|
|
28
|
+
/** The default placeholder type */
|
|
29
|
+
NONE = 0,
|
|
30
|
+
/** A NULL type having no physical storage */
|
|
31
|
+
Null = 1,
|
|
32
|
+
/** Signed or unsigned 8, 16, 32, or 64-bit little-endian integer */
|
|
33
|
+
Int = 2,
|
|
34
|
+
/** 2, 4, or 8-byte floating point value */
|
|
35
|
+
Float = 3,
|
|
36
|
+
/** Variable-length bytes (no guarantee of UTF8-ness) */
|
|
37
|
+
Binary = 4,
|
|
38
|
+
/** UTF8 variable-length string as List<Char> */
|
|
39
|
+
Utf8 = 5,
|
|
40
|
+
/** Boolean as 1 bit, LSB bit-packed ordering */
|
|
41
|
+
Bool = 6,
|
|
42
|
+
/** Precision-and-scale-based decimal type. Storage type depends on the parameters. */
|
|
43
|
+
Decimal = 7,
|
|
44
|
+
/** int32_t days or int64_t milliseconds since the UNIX epoch */
|
|
45
|
+
Date = 8,
|
|
46
|
+
/** Time as signed 32 or 64-bit integer, representing either seconds, milliseconds, microseconds, or nanoseconds since midnight since midnight */
|
|
47
|
+
Time = 9,
|
|
48
|
+
/** Exact timestamp encoded with int64 since UNIX epoch (Default unit millisecond) */
|
|
49
|
+
Timestamp = 10,
|
|
50
|
+
/** YEAR_MONTH or DAY_TIME interval in SQL style */
|
|
51
|
+
Interval = 11,
|
|
52
|
+
/** A list of some logical data type */
|
|
53
|
+
List = 12,
|
|
54
|
+
/** Struct of logical types */
|
|
55
|
+
Struct = 13,
|
|
56
|
+
/** Union of logical types */
|
|
57
|
+
Union = 14,
|
|
58
|
+
/** Fixed-size binary. Each value occupies the same number of bytes */
|
|
59
|
+
FixedSizeBinary = 15,
|
|
60
|
+
/** Fixed-size list. Each value occupies the same number of bytes */
|
|
61
|
+
FixedSizeList = 16,
|
|
62
|
+
/** Map of named logical types */
|
|
63
|
+
Map = 17,
|
|
64
|
+
/** Dictionary aka Category type */
|
|
65
|
+
Dictionary = -1,
|
|
66
|
+
Int8 = -2,
|
|
67
|
+
Int16 = -3,
|
|
68
|
+
Int32 = -4,
|
|
69
|
+
Int64 = -5,
|
|
70
|
+
Uint8 = -6,
|
|
71
|
+
Uint16 = -7,
|
|
72
|
+
Uint32 = -8,
|
|
73
|
+
Uint64 = -9,
|
|
74
|
+
Float16 = -10,
|
|
75
|
+
Float32 = -11,
|
|
76
|
+
Float64 = -12,
|
|
77
|
+
DateDay = -13,
|
|
78
|
+
DateMillisecond = -14,
|
|
79
|
+
TimestampSecond = -15,
|
|
80
|
+
TimestampMillisecond = -16,
|
|
81
|
+
TimestampMicrosecond = -17,
|
|
82
|
+
TimestampNanosecond = -18,
|
|
83
|
+
TimeSecond = -19,
|
|
84
|
+
TimeMillisecond = -20,
|
|
85
|
+
TimeMicrosecond = -21,
|
|
86
|
+
TimeNanosecond = -22,
|
|
87
|
+
DenseUnion = -23,
|
|
88
|
+
SparseUnion = -24,
|
|
89
|
+
IntervalDayTime = -25,
|
|
90
|
+
IntervalYearMonth = -26
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=enum.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enum.d.ts","sourceRoot":"","sources":["../../../../src/lib/table/arrow-api/enum.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,oBAAY,IAAI;IACd,mCAAmC;IACnC,IAAI,IAAI;IACR,6CAA6C;IAC7C,IAAI,IAAI;IACR,oEAAoE;IACpE,GAAG,IAAI;IACP,2CAA2C;IAC3C,KAAK,IAAI;IACT,wDAAwD;IACxD,MAAM,IAAI;IACV,gDAAgD;IAChD,IAAI,IAAI;IACR,gDAAgD;IAChD,IAAI,IAAI;IACR,sFAAsF;IACtF,OAAO,IAAI;IACX,gEAAgE;IAChE,IAAI,IAAI;IACR,iJAAiJ;IACjJ,IAAI,IAAI;IACR,qFAAqF;IACrF,SAAS,KAAK;IACd,mDAAmD;IACnD,QAAQ,KAAK;IACb,uCAAuC;IACvC,IAAI,KAAK;IACT,8BAA8B;IAC9B,MAAM,KAAK;IACX,6BAA6B;IAC7B,KAAK,KAAK;IACV,sEAAsE;IACtE,eAAe,KAAK;IACpB,oEAAoE;IACpE,aAAa,KAAK;IAClB,iCAAiC;IACjC,GAAG,KAAK;IAER,mCAAmC;IACnC,UAAU,KAAK;IACf,IAAI,KAAK;IACT,KAAK,KAAK;IACV,KAAK,KAAK;IACV,KAAK,KAAK;IACV,KAAK,KAAK;IACV,MAAM,KAAK;IACX,MAAM,KAAK;IACX,MAAM,KAAK;IACX,OAAO,MAAM;IACb,OAAO,MAAM;IACb,OAAO,MAAM;IACb,OAAO,MAAM;IACb,eAAe,MAAM;IACrB,eAAe,MAAM;IACrB,oBAAoB,MAAM;IAC1B,oBAAoB,MAAM;IAC1B,mBAAmB,MAAM;IACzB,UAAU,MAAM;IAChB,eAAe,MAAM;IACrB,eAAe,MAAM;IACrB,cAAc,MAAM;IACpB,UAAU,MAAM;IAChB,WAAW,MAAM;IACjB,eAAe,MAAM;IACrB,iBAAiB,MAAM;CACxB"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This code is adapted from ArrowJS https://github.com/apache/arrow
|
|
3
|
+
// under Apache license http://www.apache.org/licenses/LICENSE-2.0
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.Type = void 0;
|
|
6
|
+
/**
|
|
7
|
+
* Main data type enumeration.
|
|
8
|
+
*
|
|
9
|
+
* Data types in this library are all *logical*. They can be expressed as
|
|
10
|
+
* either a primitive physical type (bytes or bits of some fixed size), a
|
|
11
|
+
* nested type consisting of other data types, or another data type (e.g. a
|
|
12
|
+
* timestamp encoded as an int64).
|
|
13
|
+
*
|
|
14
|
+
* **Note**: Only enum values 0-17 (NONE through Map) are written to an Arrow
|
|
15
|
+
* IPC payload.
|
|
16
|
+
*
|
|
17
|
+
* The rest of the values are specified here so TypeScript can narrow the type
|
|
18
|
+
* signatures further beyond the base Arrow Types. The Arrow DataTypes include
|
|
19
|
+
* metadata like `bitWidth` that impact the type signatures of the values we
|
|
20
|
+
* accept and return.
|
|
21
|
+
*
|
|
22
|
+
* For example, the `Int8Vector` reads 1-byte numbers from an `Int8Array`, an
|
|
23
|
+
* `Int32Vector` reads a 4-byte number from an `Int32Array`, and an `Int64Vector`
|
|
24
|
+
* reads a pair of 4-byte lo, hi 32-bit integers as a zero-copy slice from the
|
|
25
|
+
* underlying `Int32Array`.
|
|
26
|
+
*
|
|
27
|
+
* Library consumers benefit by knowing the narrowest type, since we can ensure
|
|
28
|
+
* the types across all public methods are propagated, and never bail to `any`.
|
|
29
|
+
* These values are _never_ used at runtime, and they will _never_ be written
|
|
30
|
+
* to the flatbuffers metadata of serialized Arrow IPC payloads.
|
|
31
|
+
*/
|
|
32
|
+
var Type;
|
|
33
|
+
(function (Type) {
|
|
34
|
+
/** The default placeholder type */
|
|
35
|
+
Type[Type["NONE"] = 0] = "NONE";
|
|
36
|
+
/** A NULL type having no physical storage */
|
|
37
|
+
Type[Type["Null"] = 1] = "Null";
|
|
38
|
+
/** Signed or unsigned 8, 16, 32, or 64-bit little-endian integer */
|
|
39
|
+
Type[Type["Int"] = 2] = "Int";
|
|
40
|
+
/** 2, 4, or 8-byte floating point value */
|
|
41
|
+
Type[Type["Float"] = 3] = "Float";
|
|
42
|
+
/** Variable-length bytes (no guarantee of UTF8-ness) */
|
|
43
|
+
Type[Type["Binary"] = 4] = "Binary";
|
|
44
|
+
/** UTF8 variable-length string as List<Char> */
|
|
45
|
+
Type[Type["Utf8"] = 5] = "Utf8";
|
|
46
|
+
/** Boolean as 1 bit, LSB bit-packed ordering */
|
|
47
|
+
Type[Type["Bool"] = 6] = "Bool";
|
|
48
|
+
/** Precision-and-scale-based decimal type. Storage type depends on the parameters. */
|
|
49
|
+
Type[Type["Decimal"] = 7] = "Decimal";
|
|
50
|
+
/** int32_t days or int64_t milliseconds since the UNIX epoch */
|
|
51
|
+
Type[Type["Date"] = 8] = "Date";
|
|
52
|
+
/** Time as signed 32 or 64-bit integer, representing either seconds, milliseconds, microseconds, or nanoseconds since midnight since midnight */
|
|
53
|
+
Type[Type["Time"] = 9] = "Time";
|
|
54
|
+
/** Exact timestamp encoded with int64 since UNIX epoch (Default unit millisecond) */
|
|
55
|
+
Type[Type["Timestamp"] = 10] = "Timestamp";
|
|
56
|
+
/** YEAR_MONTH or DAY_TIME interval in SQL style */
|
|
57
|
+
Type[Type["Interval"] = 11] = "Interval";
|
|
58
|
+
/** A list of some logical data type */
|
|
59
|
+
Type[Type["List"] = 12] = "List";
|
|
60
|
+
/** Struct of logical types */
|
|
61
|
+
Type[Type["Struct"] = 13] = "Struct";
|
|
62
|
+
/** Union of logical types */
|
|
63
|
+
Type[Type["Union"] = 14] = "Union";
|
|
64
|
+
/** Fixed-size binary. Each value occupies the same number of bytes */
|
|
65
|
+
Type[Type["FixedSizeBinary"] = 15] = "FixedSizeBinary";
|
|
66
|
+
/** Fixed-size list. Each value occupies the same number of bytes */
|
|
67
|
+
Type[Type["FixedSizeList"] = 16] = "FixedSizeList";
|
|
68
|
+
/** Map of named logical types */
|
|
69
|
+
Type[Type["Map"] = 17] = "Map";
|
|
70
|
+
/** Dictionary aka Category type */
|
|
71
|
+
Type[Type["Dictionary"] = -1] = "Dictionary";
|
|
72
|
+
Type[Type["Int8"] = -2] = "Int8";
|
|
73
|
+
Type[Type["Int16"] = -3] = "Int16";
|
|
74
|
+
Type[Type["Int32"] = -4] = "Int32";
|
|
75
|
+
Type[Type["Int64"] = -5] = "Int64";
|
|
76
|
+
Type[Type["Uint8"] = -6] = "Uint8";
|
|
77
|
+
Type[Type["Uint16"] = -7] = "Uint16";
|
|
78
|
+
Type[Type["Uint32"] = -8] = "Uint32";
|
|
79
|
+
Type[Type["Uint64"] = -9] = "Uint64";
|
|
80
|
+
Type[Type["Float16"] = -10] = "Float16";
|
|
81
|
+
Type[Type["Float32"] = -11] = "Float32";
|
|
82
|
+
Type[Type["Float64"] = -12] = "Float64";
|
|
83
|
+
Type[Type["DateDay"] = -13] = "DateDay";
|
|
84
|
+
Type[Type["DateMillisecond"] = -14] = "DateMillisecond";
|
|
85
|
+
Type[Type["TimestampSecond"] = -15] = "TimestampSecond";
|
|
86
|
+
Type[Type["TimestampMillisecond"] = -16] = "TimestampMillisecond";
|
|
87
|
+
Type[Type["TimestampMicrosecond"] = -17] = "TimestampMicrosecond";
|
|
88
|
+
Type[Type["TimestampNanosecond"] = -18] = "TimestampNanosecond";
|
|
89
|
+
Type[Type["TimeSecond"] = -19] = "TimeSecond";
|
|
90
|
+
Type[Type["TimeMillisecond"] = -20] = "TimeMillisecond";
|
|
91
|
+
Type[Type["TimeMicrosecond"] = -21] = "TimeMicrosecond";
|
|
92
|
+
Type[Type["TimeNanosecond"] = -22] = "TimeNanosecond";
|
|
93
|
+
Type[Type["DenseUnion"] = -23] = "DenseUnion";
|
|
94
|
+
Type[Type["SparseUnion"] = -24] = "SparseUnion";
|
|
95
|
+
Type[Type["IntervalDayTime"] = -25] = "IntervalDayTime";
|
|
96
|
+
Type[Type["IntervalYearMonth"] = -26] = "IntervalYearMonth";
|
|
97
|
+
})(Type = exports.Type || (exports.Type = {}));
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Type } from './arrow-like-type';
|
|
2
|
+
/**
|
|
3
|
+
* Gets type information from an Arrow type object or "mock" Arrow type object
|
|
4
|
+
* @param arrowTypeLike Arrow Type or type object of similar shape
|
|
5
|
+
*/
|
|
6
|
+
export declare function getTypeInfo(arrowTypeLike: any): {
|
|
7
|
+
typeId: Type;
|
|
8
|
+
ArrayType: ArrayLike<unknown>;
|
|
9
|
+
typeName: string;
|
|
10
|
+
typeEnumName?: string;
|
|
11
|
+
precision?: number;
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=get-type-info.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-type-info.d.ts","sourceRoot":"","sources":["../../../../src/lib/table/arrow-api/get-type-info.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,IAAI,EAAC,MAAM,mBAAmB,CAAC;AAEvC;;;GAGG;AACH,wBAAgB,WAAW,CAAC,aAAa,EAAE,GAAG,GAAG;IAC/C,MAAM,EAAE,IAAI,CAAC;IACb,SAAS,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAQA"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// loaders.gl, MIT license
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.getTypeInfo = void 0;
|
|
5
|
+
const arrow_like_type_1 = require("./arrow-like-type");
|
|
6
|
+
/**
|
|
7
|
+
* Gets type information from an Arrow type object or "mock" Arrow type object
|
|
8
|
+
* @param arrowTypeLike Arrow Type or type object of similar shape
|
|
9
|
+
*/
|
|
10
|
+
function getTypeInfo(arrowTypeLike) {
|
|
11
|
+
return {
|
|
12
|
+
typeId: arrowTypeLike.typeId,
|
|
13
|
+
ArrayType: arrowTypeLike.ArrayType,
|
|
14
|
+
typeName: arrowTypeLike.toString(),
|
|
15
|
+
typeEnumName: getTypeKey(arrowTypeLike.typeId),
|
|
16
|
+
precision: arrowTypeLike.precision
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
exports.getTypeInfo = getTypeInfo;
|
|
20
|
+
let ReverseType = null;
|
|
21
|
+
function getTypeKey(typeKey) {
|
|
22
|
+
if (!ReverseType) {
|
|
23
|
+
ReverseType = {};
|
|
24
|
+
for (const key in arrow_like_type_1.Type) {
|
|
25
|
+
ReverseType[arrow_like_type_1.Type[key]] = key;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return ReverseType[typeKey];
|
|
29
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/lib/table/arrow-api/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,cAAc,IAAI,KAAK,EAAC,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAC,eAAe,IAAI,MAAM,EAAC,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAC,cAAc,IAAI,KAAK,EAAC,MAAM,oBAAoB,CAAC;AAC3D,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// loaders.gl, MIT license
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
15
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
16
|
+
};
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.Table = exports.Schema = exports.Field = void 0;
|
|
19
|
+
var arrow_like_field_1 = require("./arrow-like-field");
|
|
20
|
+
Object.defineProperty(exports, "Field", { enumerable: true, get: function () { return arrow_like_field_1.ArrowLikeField; } });
|
|
21
|
+
var arrow_like_schema_1 = require("./arrow-like-schema");
|
|
22
|
+
Object.defineProperty(exports, "Schema", { enumerable: true, get: function () { return arrow_like_schema_1.ArrowLikeSchema; } });
|
|
23
|
+
var arrow_like_table_1 = require("./arrow-like-table");
|
|
24
|
+
Object.defineProperty(exports, "Table", { enumerable: true, get: function () { return arrow_like_table_1.ArrowLikeTable; } });
|
|
25
|
+
__exportStar(require("./arrow-like-type"), exports);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Schema } from '../../../types/schema';
|
|
2
|
+
import type { TableBatch } from '../../../types/category-table';
|
|
3
|
+
import { TableBatchAggregator, TableBatchOptions } from './table-batch-aggregator';
|
|
4
|
+
export declare class BaseTableBatchAggregator implements TableBatchAggregator {
|
|
5
|
+
schema: Schema;
|
|
6
|
+
options: TableBatchOptions;
|
|
7
|
+
length: number;
|
|
8
|
+
rows: any[] | null;
|
|
9
|
+
cursor: number;
|
|
10
|
+
private _headers;
|
|
11
|
+
constructor(schema: Schema, options: TableBatchOptions);
|
|
12
|
+
rowCount(): number;
|
|
13
|
+
addArrayRow(row: any[], cursor?: number): void;
|
|
14
|
+
addObjectRow(row: {
|
|
15
|
+
[columnName: string]: any;
|
|
16
|
+
}, cursor?: number): void;
|
|
17
|
+
getBatch(): TableBatch | null;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=base-table-batch-aggregator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-table-batch-aggregator.d.ts","sourceRoot":"","sources":["../../../../src/lib/table/batches/base-table-batch-aggregator.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,uBAAuB,CAAC;AAClD,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAC,oBAAoB,EAAE,iBAAiB,EAAC,MAAM,0BAA0B,CAAC;AAIjF,qBAAa,wBAAyB,YAAW,oBAAoB;IACnE,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,iBAAiB,CAAC;IAE3B,MAAM,EAAE,MAAM,CAAK;IACnB,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI,CAAQ;IAC1B,MAAM,EAAE,MAAM,CAAK;IACnB,OAAO,CAAC,QAAQ,CAAgB;gBAEpB,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,iBAAiB;IActD,QAAQ,IAAI,MAAM;IAIlB,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI;IAU9C,YAAY,CAAC,GAAG,EAAE;QAAC,CAAC,UAAU,EAAE,MAAM,GAAG,GAAG,CAAA;KAAC,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI;IAUrE,QAAQ,IAAI,UAAU,GAAG,IAAI;CAoB9B"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// loaders.gl, MIT license
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.BaseTableBatchAggregator = void 0;
|
|
5
|
+
const DEFAULT_ROW_COUNT = 100;
|
|
6
|
+
class BaseTableBatchAggregator {
|
|
7
|
+
constructor(schema, options) {
|
|
8
|
+
this.length = 0;
|
|
9
|
+
this.rows = null;
|
|
10
|
+
this.cursor = 0;
|
|
11
|
+
this._headers = [];
|
|
12
|
+
this.options = options;
|
|
13
|
+
this.schema = schema;
|
|
14
|
+
// schema is an array if there're no headers
|
|
15
|
+
// object if there are headers
|
|
16
|
+
if (!Array.isArray(schema)) {
|
|
17
|
+
this._headers = [];
|
|
18
|
+
for (const key in schema) {
|
|
19
|
+
this._headers[schema[key].index] = schema[key].name;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
rowCount() {
|
|
24
|
+
return this.length;
|
|
25
|
+
}
|
|
26
|
+
addArrayRow(row, cursor) {
|
|
27
|
+
if (Number.isFinite(cursor)) {
|
|
28
|
+
this.cursor = cursor;
|
|
29
|
+
}
|
|
30
|
+
this.rows = this.rows || new Array(DEFAULT_ROW_COUNT);
|
|
31
|
+
this.rows[this.length] = row;
|
|
32
|
+
this.length++;
|
|
33
|
+
}
|
|
34
|
+
addObjectRow(row, cursor) {
|
|
35
|
+
if (Number.isFinite(cursor)) {
|
|
36
|
+
this.cursor = cursor;
|
|
37
|
+
}
|
|
38
|
+
this.rows = this.rows || new Array(DEFAULT_ROW_COUNT);
|
|
39
|
+
this.rows[this.length] = row;
|
|
40
|
+
this.length++;
|
|
41
|
+
}
|
|
42
|
+
getBatch() {
|
|
43
|
+
let rows = this.rows;
|
|
44
|
+
if (!rows) {
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
rows = rows.slice(0, this.length);
|
|
48
|
+
this.rows = null;
|
|
49
|
+
const batch = {
|
|
50
|
+
shape: this.options.shape,
|
|
51
|
+
batchType: 'data',
|
|
52
|
+
data: rows,
|
|
53
|
+
length: this.length,
|
|
54
|
+
schema: this.schema,
|
|
55
|
+
cursor: this.cursor
|
|
56
|
+
};
|
|
57
|
+
return batch;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
exports.BaseTableBatchAggregator = BaseTableBatchAggregator;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Schema } from '../../../types/schema';
|
|
2
|
+
import type { ColumnarTableBatch, ArrowTableBatch } from '../../../types/category-table';
|
|
3
|
+
import { TableBatchAggregator } from './table-batch-aggregator';
|
|
4
|
+
type ColumnarTableBatchOptions = {};
|
|
5
|
+
export declare class ColumnarTableBatchAggregator implements TableBatchAggregator {
|
|
6
|
+
schema: Schema;
|
|
7
|
+
length: number;
|
|
8
|
+
allocated: number;
|
|
9
|
+
columns: {
|
|
10
|
+
[columnName: string]: any[];
|
|
11
|
+
};
|
|
12
|
+
constructor(schema: Schema, options: ColumnarTableBatchOptions);
|
|
13
|
+
rowCount(): number;
|
|
14
|
+
addArrayRow(row: any[]): void;
|
|
15
|
+
addObjectRow(row: {
|
|
16
|
+
[columnName: string]: any;
|
|
17
|
+
}): void;
|
|
18
|
+
getBatch(): ColumnarTableBatch | ArrowTableBatch | null;
|
|
19
|
+
_reallocateColumns(): void;
|
|
20
|
+
_pruneColumns(): void;
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=columnar-table-batch-aggregator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"columnar-table-batch-aggregator.d.ts","sourceRoot":"","sources":["../../../../src/lib/table/batches/columnar-table-batch-aggregator.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,uBAAuB,CAAC;AAClD,OAAO,KAAK,EAAC,kBAAkB,EAAE,eAAe,EAAC,MAAM,+BAA+B,CAAC;AACvF,OAAO,EAAC,oBAAoB,EAAC,MAAM,0BAA0B,CAAC;AAE9D,KAAK,yBAAyB,GAAG,EAAE,CAAC;AAIpC,qBAAa,4BAA6B,YAAW,oBAAoB;IACvE,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAK;IACnB,SAAS,EAAE,MAAM,CAAK;IACtB,OAAO,EAAE;QAAC,CAAC,UAAU,EAAE,MAAM,GAAG,GAAG,EAAE,CAAA;KAAC,CAAM;gBAEhC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,yBAAyB;IAK9D,QAAQ,IAAI,MAAM;IAIlB,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE;IAWtB,YAAY,CAAC,GAAG,EAAE;QAAC,CAAC,UAAU,EAAE,MAAM,GAAG,GAAG,CAAA;KAAC,GAAG,IAAI;IASpD,QAAQ,IAAI,kBAAkB,GAAG,eAAe,GAAG,IAAI;IA6BvD,kBAAkB;IA8BlB,aAAa;CAKd"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// loaders.gl, MIT license
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.ColumnarTableBatchAggregator = void 0;
|
|
5
|
+
const DEFAULT_ROW_COUNT = 100;
|
|
6
|
+
class ColumnarTableBatchAggregator {
|
|
7
|
+
constructor(schema, options) {
|
|
8
|
+
this.length = 0;
|
|
9
|
+
this.allocated = 0;
|
|
10
|
+
this.columns = {};
|
|
11
|
+
this.schema = schema;
|
|
12
|
+
this._reallocateColumns();
|
|
13
|
+
}
|
|
14
|
+
rowCount() {
|
|
15
|
+
return this.length;
|
|
16
|
+
}
|
|
17
|
+
addArrayRow(row) {
|
|
18
|
+
// If user keeps pushing rows beyond batch size, reallocate
|
|
19
|
+
this._reallocateColumns();
|
|
20
|
+
let i = 0;
|
|
21
|
+
// TODO what if no csv header, columns not populated?
|
|
22
|
+
for (const fieldName in this.columns) {
|
|
23
|
+
this.columns[fieldName][this.length] = row[i++];
|
|
24
|
+
}
|
|
25
|
+
this.length++;
|
|
26
|
+
}
|
|
27
|
+
addObjectRow(row) {
|
|
28
|
+
// If user keeps pushing rows beyond batch size, reallocate
|
|
29
|
+
this._reallocateColumns();
|
|
30
|
+
for (const fieldName in row) {
|
|
31
|
+
this.columns[fieldName][this.length] = row[fieldName];
|
|
32
|
+
}
|
|
33
|
+
this.length++;
|
|
34
|
+
}
|
|
35
|
+
getBatch() {
|
|
36
|
+
this._pruneColumns();
|
|
37
|
+
const columns = Array.isArray(this.schema) ? this.columns : {};
|
|
38
|
+
// schema is an array if there're no headers
|
|
39
|
+
// object if there are headers
|
|
40
|
+
// columns should match schema format
|
|
41
|
+
if (!Array.isArray(this.schema)) {
|
|
42
|
+
for (const fieldName in this.schema) {
|
|
43
|
+
const field = this.schema[fieldName];
|
|
44
|
+
columns[field.name] = this.columns[field.index];
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
this.columns = {};
|
|
48
|
+
const batch = {
|
|
49
|
+
shape: 'columnar-table',
|
|
50
|
+
batchType: 'data',
|
|
51
|
+
data: columns,
|
|
52
|
+
schema: this.schema,
|
|
53
|
+
length: this.length
|
|
54
|
+
};
|
|
55
|
+
return batch;
|
|
56
|
+
}
|
|
57
|
+
// HELPERS
|
|
58
|
+
_reallocateColumns() {
|
|
59
|
+
if (this.length < this.allocated) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
// @ts-ignore TODO
|
|
63
|
+
this.allocated = this.allocated > 0 ? (this.allocated *= 2) : DEFAULT_ROW_COUNT;
|
|
64
|
+
this.columns = {};
|
|
65
|
+
for (const fieldName in this.schema) {
|
|
66
|
+
const field = this.schema[fieldName];
|
|
67
|
+
const ArrayType = field.type || Float32Array;
|
|
68
|
+
const oldColumn = this.columns[field.index];
|
|
69
|
+
if (oldColumn && ArrayBuffer.isView(oldColumn)) {
|
|
70
|
+
// Copy the old data to the new array
|
|
71
|
+
const typedArray = new ArrayType(this.allocated);
|
|
72
|
+
typedArray.set(oldColumn);
|
|
73
|
+
this.columns[field.index] = typedArray;
|
|
74
|
+
}
|
|
75
|
+
else if (oldColumn) {
|
|
76
|
+
// Plain array
|
|
77
|
+
oldColumn.length = this.allocated;
|
|
78
|
+
this.columns[field.index] = oldColumn;
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
// Create new
|
|
82
|
+
this.columns[field.index] = new ArrayType(this.allocated);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
_pruneColumns() {
|
|
87
|
+
for (const [columnName, column] of Object.entries(this.columns)) {
|
|
88
|
+
this.columns[columnName] = column.slice(0, this.length);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
exports.ColumnarTableBatchAggregator = ColumnarTableBatchAggregator;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Schema } from '../../../types/schema';
|
|
2
|
+
import type { TableBatch } from '../../../types/category-table';
|
|
3
|
+
import { TableBatchAggregator, TableBatchOptions } from './table-batch-aggregator';
|
|
4
|
+
export declare class RowTableBatchAggregator implements TableBatchAggregator {
|
|
5
|
+
schema: Schema;
|
|
6
|
+
options: TableBatchOptions;
|
|
7
|
+
length: number;
|
|
8
|
+
objectRows: {
|
|
9
|
+
[columnName: string]: any;
|
|
10
|
+
} | null;
|
|
11
|
+
arrayRows: any[] | null;
|
|
12
|
+
cursor: number;
|
|
13
|
+
private _headers;
|
|
14
|
+
constructor(schema: Schema, options: TableBatchOptions);
|
|
15
|
+
rowCount(): number;
|
|
16
|
+
addArrayRow(row: any[], cursor?: number): void;
|
|
17
|
+
addObjectRow(row: {
|
|
18
|
+
[columnName: string]: any;
|
|
19
|
+
}, cursor?: number): void;
|
|
20
|
+
getBatch(): TableBatch | null;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=row-table-batch-aggregator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"row-table-batch-aggregator.d.ts","sourceRoot":"","sources":["../../../../src/lib/table/batches/row-table-batch-aggregator.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,uBAAuB,CAAC;AAClD,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,+BAA+B,CAAC;AAG9D,OAAO,EAAC,oBAAoB,EAAE,iBAAiB,EAAC,MAAM,0BAA0B,CAAC;AAIjF,qBAAa,uBAAwB,YAAW,oBAAoB;IAClE,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,iBAAiB,CAAC;IAE3B,MAAM,EAAE,MAAM,CAAK;IACnB,UAAU,EAAE;QAAC,CAAC,UAAU,EAAE,MAAM,GAAG,GAAG,CAAA;KAAC,GAAG,IAAI,CAAQ;IACtD,SAAS,EAAE,GAAG,EAAE,GAAG,IAAI,CAAQ;IAC/B,MAAM,EAAE,MAAM,CAAK;IACnB,OAAO,CAAC,QAAQ,CAAgB;gBAEpB,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,iBAAiB;IActD,QAAQ,IAAI,MAAM;IAIlB,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI;IAmB9C,YAAY,CAAC,GAAG,EAAE;QAAC,CAAC,UAAU,EAAE,MAAM,GAAG,GAAG,CAAA;KAAC,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI;IAmBrE,QAAQ,IAAI,UAAU,GAAG,IAAI;CAmB9B"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// loaders.gl, MIT license
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.RowTableBatchAggregator = void 0;
|
|
5
|
+
// import type {ArrayRowTableBatch, ObjectRowTableBatch} from '../../category/table.js';
|
|
6
|
+
const row_utils_1 = require("../simple-table/row-utils");
|
|
7
|
+
const DEFAULT_ROW_COUNT = 100;
|
|
8
|
+
class RowTableBatchAggregator {
|
|
9
|
+
constructor(schema, options) {
|
|
10
|
+
this.length = 0;
|
|
11
|
+
this.objectRows = null;
|
|
12
|
+
this.arrayRows = null;
|
|
13
|
+
this.cursor = 0;
|
|
14
|
+
this._headers = [];
|
|
15
|
+
this.options = options;
|
|
16
|
+
this.schema = schema;
|
|
17
|
+
// schema is an array if there're no headers
|
|
18
|
+
// object if there are headers
|
|
19
|
+
if (!Array.isArray(schema)) {
|
|
20
|
+
this._headers = [];
|
|
21
|
+
for (const key in schema) {
|
|
22
|
+
this._headers[schema[key].index] = schema[key].name;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
rowCount() {
|
|
27
|
+
return this.length;
|
|
28
|
+
}
|
|
29
|
+
addArrayRow(row, cursor) {
|
|
30
|
+
if (Number.isFinite(cursor)) {
|
|
31
|
+
this.cursor = cursor;
|
|
32
|
+
}
|
|
33
|
+
// eslint-disable-next-line default-case
|
|
34
|
+
switch (this.options.shape) {
|
|
35
|
+
case 'object-row-table':
|
|
36
|
+
const rowObject = (0, row_utils_1.convertToObjectRow)(row, this._headers);
|
|
37
|
+
this.addObjectRow(rowObject, cursor);
|
|
38
|
+
break;
|
|
39
|
+
case 'array-row-table':
|
|
40
|
+
this.arrayRows = this.arrayRows || new Array(DEFAULT_ROW_COUNT);
|
|
41
|
+
this.arrayRows[this.length] = row;
|
|
42
|
+
this.length++;
|
|
43
|
+
break;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
addObjectRow(row, cursor) {
|
|
47
|
+
if (Number.isFinite(cursor)) {
|
|
48
|
+
this.cursor = cursor;
|
|
49
|
+
}
|
|
50
|
+
// eslint-disable-next-line default-case
|
|
51
|
+
switch (this.options.shape) {
|
|
52
|
+
case 'array-row-table':
|
|
53
|
+
const rowArray = (0, row_utils_1.convertToArrayRow)(row, this._headers);
|
|
54
|
+
this.addArrayRow(rowArray, cursor);
|
|
55
|
+
break;
|
|
56
|
+
case 'object-row-table':
|
|
57
|
+
this.objectRows = this.objectRows || new Array(DEFAULT_ROW_COUNT);
|
|
58
|
+
this.objectRows[this.length] = row;
|
|
59
|
+
this.length++;
|
|
60
|
+
break;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
getBatch() {
|
|
64
|
+
let rows = this.arrayRows || this.objectRows;
|
|
65
|
+
if (!rows) {
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
rows = rows.slice(0, this.length);
|
|
69
|
+
this.arrayRows = null;
|
|
70
|
+
this.objectRows = null;
|
|
71
|
+
return {
|
|
72
|
+
shape: this.options.shape,
|
|
73
|
+
batchType: 'data',
|
|
74
|
+
data: rows,
|
|
75
|
+
length: this.length,
|
|
76
|
+
schema: this.schema,
|
|
77
|
+
cursor: this.cursor
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
exports.RowTableBatchAggregator = RowTableBatchAggregator;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Schema } from '../../../types/schema';
|
|
2
|
+
import type { TableBatch } from '../../../types/category-table';
|
|
3
|
+
export interface TableBatchOptions {
|
|
4
|
+
batchSize: number | string;
|
|
5
|
+
[key: string]: any;
|
|
6
|
+
}
|
|
7
|
+
export interface TableBatchConstructor {
|
|
8
|
+
new (schema: Schema, options: TableBatchOptions): TableBatchAggregator;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* TableBatchBuilder delegates batch building to this interface
|
|
12
|
+
*/
|
|
13
|
+
export interface TableBatchAggregator {
|
|
14
|
+
/** Number of rows */
|
|
15
|
+
rowCount(): number;
|
|
16
|
+
/** Add one row */
|
|
17
|
+
addArrayRow(row: any[]): void;
|
|
18
|
+
/** Add one row */
|
|
19
|
+
addObjectRow(row: {
|
|
20
|
+
[columnName: string]: any;
|
|
21
|
+
}): void;
|
|
22
|
+
/** return a batch object */
|
|
23
|
+
getBatch(): TableBatch | null;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=table-batch-aggregator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table-batch-aggregator.d.ts","sourceRoot":"","sources":["../../../../src/lib/table/batches/table-batch-aggregator.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,uBAAuB,CAAC;AAClD,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,+BAA+B,CAAC;AAE9D,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED,MAAM,WAAW,qBAAqB;IACpC,KAAK,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,iBAAiB,GAAG,oBAAoB,CAAC;CACxE;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,qBAAqB;IACrB,QAAQ,IAAI,MAAM,CAAC;IACnB,kBAAkB;IAClB,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC;IAC9B,kBAAkB;IAClB,YAAY,CAAC,GAAG,EAAE;QAAC,CAAC,UAAU,EAAE,MAAM,GAAG,GAAG,CAAA;KAAC,GAAG,IAAI,CAAC;IACrD,4BAA4B;IAC5B,QAAQ,IAAI,UAAU,GAAG,IAAI,CAAC;CAC/B"}
|