@loaders.gl/schema 4.0.0-alpha.1 → 4.0.0-alpha.11
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
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import type {Schema} from '../../lib/schema';
|
|
2
|
-
import type {Table as ApacheArrowTable, RecordBatch} from 'apache-arrow/Arrow.dom';
|
|
3
|
-
import type {AnyArray} from '../../types';
|
|
4
|
-
import type {Batch} from '../common';
|
|
5
|
-
|
|
6
|
-
/** A general table */
|
|
7
|
-
export interface Table {
|
|
8
|
-
shape: 'row-table' | 'array-row-table' | 'object-row-table' | 'columnar-table' | 'arrow-table';
|
|
9
|
-
schema?: Schema;
|
|
10
|
-
schemaType?: 'explicit' | 'deduced';
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
/** A table organized as an array of rows */
|
|
14
|
-
export interface RowTable extends Table {
|
|
15
|
-
shape: 'row-table' | 'array-row-table' | 'object-row-table';
|
|
16
|
-
data: any[];
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/** A table organized as an array of rows, each row is an array of values */
|
|
20
|
-
export interface ArrayRowTable extends RowTable {
|
|
21
|
-
shape: 'array-row-table';
|
|
22
|
-
data: any[][];
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/** A table organized as an array of rows, each row is an object mapping columns to values */
|
|
26
|
-
export interface ObjectRowTable extends RowTable {
|
|
27
|
-
shape: 'object-row-table';
|
|
28
|
-
data: {[columnName: string]: any}[];
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/** A table organized as a map of columns, each column is an array of value */
|
|
32
|
-
export interface ColumnarTable extends Table {
|
|
33
|
-
shape: 'columnar-table';
|
|
34
|
-
data: {[columnName: string]: AnyArray};
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/** A table organized as an Apache Arrow table */
|
|
38
|
-
export interface ArrowTable extends Table {
|
|
39
|
-
shape: 'arrow-table';
|
|
40
|
-
data: ApacheArrowTable;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
// Batches
|
|
44
|
-
|
|
45
|
-
/** Batch for a general table */
|
|
46
|
-
export type TableBatch = Batch & {
|
|
47
|
-
data: any;
|
|
48
|
-
length: number;
|
|
49
|
-
schema?: Schema;
|
|
50
|
-
schemaType?: 'explicit' | 'deduced';
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
/** Batch for a table organized as an array of rows */
|
|
54
|
-
export type RowTableBatch = TableBatch & {
|
|
55
|
-
shape: 'row-table';
|
|
56
|
-
data: any[];
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
/** Batch for a table organized as an array of rows, each row is an array of values */
|
|
60
|
-
export type RowArrayTableBatch = RowTableBatch & {
|
|
61
|
-
shape: 'array-row-table';
|
|
62
|
-
data: any[][];
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
/** Batch for a table organized as an array of rows, each row is an object mapping columns to values */
|
|
66
|
-
export type RowObjectTableBatch = RowTableBatch & {
|
|
67
|
-
shape: 'object-row-table';
|
|
68
|
-
data: {[columnName: string]: any}[];
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
/** Batch for a table organized as a map of columns, each column is an array of value */
|
|
72
|
-
export type ColumnarTableBatch = TableBatch & {
|
|
73
|
-
shape: 'columnar-table';
|
|
74
|
-
data: {[columnName: string]: AnyArray};
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
/** Batch for a table organized as an Apache Arrow table */
|
|
78
|
-
export type ArrowTableBatch = TableBatch & {
|
|
79
|
-
shape: 'arrow-table';
|
|
80
|
-
data: RecordBatch;
|
|
81
|
-
};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type {TypedArray} from '../../types';
|
|
2
|
-
import {DataType, Float32, Float64, Int16, Int32, Int8, Uint16, Uint32, Uint8} from '../schema';
|
|
3
|
-
|
|
4
|
-
export function getArrowTypeFromTypedArray(array: TypedArray): DataType {
|
|
5
|
-
switch (array.constructor) {
|
|
6
|
-
case Int8Array:
|
|
7
|
-
return new Int8();
|
|
8
|
-
case Uint8Array:
|
|
9
|
-
return new Uint8();
|
|
10
|
-
case Int16Array:
|
|
11
|
-
return new Int16();
|
|
12
|
-
case Uint16Array:
|
|
13
|
-
return new Uint16();
|
|
14
|
-
case Int32Array:
|
|
15
|
-
return new Int32();
|
|
16
|
-
case Uint32Array:
|
|
17
|
-
return new Uint32();
|
|
18
|
-
case Float32Array:
|
|
19
|
-
return new Float32();
|
|
20
|
-
case Float64Array:
|
|
21
|
-
return new Float64();
|
|
22
|
-
default:
|
|
23
|
-
throw new Error('array type not supported');
|
|
24
|
-
}
|
|
25
|
-
}
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import {assert} from '../../utils/assert';
|
|
2
|
-
import Field from './field';
|
|
3
|
-
|
|
4
|
-
export type SchemaMetadata = Map<string, any>;
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* ArrowJS `Schema` API-compatible class for row-based tables (returned from `DataTable`)
|
|
8
|
-
* https://loaders.gl/arrowjs/docs/api-reference/schema
|
|
9
|
-
*/
|
|
10
|
-
export default class Schema {
|
|
11
|
-
fields: Field[];
|
|
12
|
-
// TODO - Arrow just allows Map<string, string>
|
|
13
|
-
metadata: SchemaMetadata;
|
|
14
|
-
|
|
15
|
-
constructor(fields: Field[], metadata?: SchemaMetadata) {
|
|
16
|
-
assert(Array.isArray(fields));
|
|
17
|
-
checkNames(fields);
|
|
18
|
-
// For kepler fields, create arrow compatible `Fields` that have kepler fields as `metadata`
|
|
19
|
-
this.fields = fields;
|
|
20
|
-
this.metadata = metadata || new Map();
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
// TODO - arrow only seems to compare fields, not metadata
|
|
24
|
-
compareTo(other: Schema): boolean {
|
|
25
|
-
if (this.metadata !== other.metadata) {
|
|
26
|
-
return false;
|
|
27
|
-
}
|
|
28
|
-
if (this.fields.length !== other.fields.length) {
|
|
29
|
-
return false;
|
|
30
|
-
}
|
|
31
|
-
for (let i = 0; i < this.fields.length; ++i) {
|
|
32
|
-
if (!this.fields[i].compareTo(other.fields[i])) {
|
|
33
|
-
return false;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
return true;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
select(...columnNames: string[]): Schema {
|
|
40
|
-
// Ensure column names reference valid fields
|
|
41
|
-
const nameMap = Object.create(null);
|
|
42
|
-
for (const name of columnNames) {
|
|
43
|
-
nameMap[name] = true;
|
|
44
|
-
}
|
|
45
|
-
const selectedFields = this.fields.filter((field) => nameMap[field.name]);
|
|
46
|
-
return new Schema(selectedFields, this.metadata);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
selectAt(...columnIndices: number[]): Schema {
|
|
50
|
-
// Ensure column indices reference valid fields
|
|
51
|
-
const selectedFields = columnIndices.map((index) => this.fields[index]).filter(Boolean);
|
|
52
|
-
return new Schema(selectedFields, this.metadata);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
assign(schemaOrFields: Schema | Field[]): Schema {
|
|
56
|
-
let fields: Field[];
|
|
57
|
-
let metadata: SchemaMetadata = this.metadata;
|
|
58
|
-
|
|
59
|
-
if (schemaOrFields instanceof Schema) {
|
|
60
|
-
const otherSchema = schemaOrFields;
|
|
61
|
-
fields = otherSchema.fields;
|
|
62
|
-
metadata = mergeMaps(mergeMaps(new Map(), this.metadata), otherSchema.metadata);
|
|
63
|
-
} else {
|
|
64
|
-
fields = schemaOrFields;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
// Create a merged list of fields, overwrite fields in place, new fields at end
|
|
68
|
-
const fieldMap: {[key: string]: Field} = Object.create(null);
|
|
69
|
-
|
|
70
|
-
for (const field of this.fields) {
|
|
71
|
-
fieldMap[field.name] = field;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
for (const field of fields) {
|
|
75
|
-
fieldMap[field.name] = field;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
const mergedFields = Object.values(fieldMap);
|
|
79
|
-
|
|
80
|
-
return new Schema(mergedFields, metadata);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
// Warn if any duplicated field names
|
|
85
|
-
function checkNames(fields: Field[]): void {
|
|
86
|
-
const usedNames: Record<string, boolean> = {};
|
|
87
|
-
for (const field of fields) {
|
|
88
|
-
if (usedNames[field.name]) {
|
|
89
|
-
// eslint-disable-next-line
|
|
90
|
-
console.warn('Schema: duplicated field name', field.name, field);
|
|
91
|
-
}
|
|
92
|
-
usedNames[field.name] = true;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
function mergeMaps<T>(m1: T, m2: T): T {
|
|
97
|
-
// @ts-ignore
|
|
98
|
-
return new Map([...(m1 || new Map()), ...(m2 || new Map())]);
|
|
99
|
-
}
|
package/src/lib/schema/index.ts
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
export {
|
|
3
|
-
Schema,
|
|
4
|
-
Field,
|
|
5
|
-
DataType,
|
|
6
|
-
Null,
|
|
7
|
-
Bool,
|
|
8
|
-
Int,
|
|
9
|
-
Int8,
|
|
10
|
-
Int16,
|
|
11
|
-
Int32,
|
|
12
|
-
Int64,
|
|
13
|
-
Uint8,
|
|
14
|
-
Uint16,
|
|
15
|
-
Uint32,
|
|
16
|
-
Uint64,
|
|
17
|
-
Float,
|
|
18
|
-
Float16,
|
|
19
|
-
Float32,
|
|
20
|
-
Float64,
|
|
21
|
-
Binary,
|
|
22
|
-
Utf8,
|
|
23
|
-
Date,
|
|
24
|
-
DateDay,
|
|
25
|
-
DateMillisecond,
|
|
26
|
-
Time,
|
|
27
|
-
TimeSecond,
|
|
28
|
-
TimeMillisecond,
|
|
29
|
-
TimeMicrosecond,
|
|
30
|
-
TimeNanosecond,
|
|
31
|
-
Timestamp,
|
|
32
|
-
TimestampSecond,
|
|
33
|
-
TimestampMillisecond,
|
|
34
|
-
TimestampMicrosecond,
|
|
35
|
-
TimestampNanosecond,
|
|
36
|
-
Interval,
|
|
37
|
-
IntervalDayTime,
|
|
38
|
-
IntervalYearMonth,
|
|
39
|
-
FixedSizeList
|
|
40
|
-
} from 'apache-arrow';
|
|
41
|
-
*/
|
|
42
|
-
export {default as Schema} from './impl/schema';
|
|
43
|
-
export {default as Field} from './impl/field';
|
|
44
|
-
export {Type} from './impl/type';
|
|
45
|
-
export {
|
|
46
|
-
DataType,
|
|
47
|
-
Null,
|
|
48
|
-
Bool,
|
|
49
|
-
Int,
|
|
50
|
-
Int8,
|
|
51
|
-
Int16,
|
|
52
|
-
Int32,
|
|
53
|
-
Int64,
|
|
54
|
-
Uint8,
|
|
55
|
-
Uint16,
|
|
56
|
-
Uint32,
|
|
57
|
-
Uint64,
|
|
58
|
-
Float,
|
|
59
|
-
Float16,
|
|
60
|
-
Float32,
|
|
61
|
-
Float64,
|
|
62
|
-
Binary,
|
|
63
|
-
Utf8,
|
|
64
|
-
Date,
|
|
65
|
-
DateDay,
|
|
66
|
-
DateMillisecond,
|
|
67
|
-
Time,
|
|
68
|
-
TimeSecond,
|
|
69
|
-
TimeMillisecond,
|
|
70
|
-
// TimeMicrosecond,
|
|
71
|
-
// TimeNanosecond,
|
|
72
|
-
Timestamp,
|
|
73
|
-
TimestampSecond,
|
|
74
|
-
TimestampMillisecond,
|
|
75
|
-
TimestampMicrosecond,
|
|
76
|
-
TimestampNanosecond,
|
|
77
|
-
Interval,
|
|
78
|
-
IntervalDayTime,
|
|
79
|
-
IntervalYearMonth,
|
|
80
|
-
FixedSizeList,
|
|
81
|
-
Struct
|
|
82
|
-
} from './impl/type';
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
// Type deduction
|
|
2
|
-
// import {
|
|
3
|
-
// Schema
|
|
4
|
-
// Int,
|
|
5
|
-
// Int8,
|
|
6
|
-
// Int16,
|
|
7
|
-
// Int32,
|
|
8
|
-
// Uint8,
|
|
9
|
-
// Uint16,
|
|
10
|
-
// Uint32,
|
|
11
|
-
// Float32,
|
|
12
|
-
// Float64
|
|
13
|
-
// Bool,
|
|
14
|
-
// Utf8,
|
|
15
|
-
// TimestampMillisecond,
|
|
16
|
-
// Null
|
|
17
|
-
// } from '../schema';
|
|
18
|
-
|
|
19
|
-
// const TYPED_ARRAY_TO_TYPE = {
|
|
20
|
-
// Int8Array: new Int8(),
|
|
21
|
-
// Int16Array: new Int16(),
|
|
22
|
-
// Int32Array: new Int32(),
|
|
23
|
-
// Uint8Array: new Uint8(),
|
|
24
|
-
// Uint8ClampedArray: new Uint8(),
|
|
25
|
-
// Uint16Array: new Uint16(),
|
|
26
|
-
// Uint32Array: new Uint32(),
|
|
27
|
-
// Float32Array: new Float32(),
|
|
28
|
-
// Float64Array: new Float64()
|
|
29
|
-
// };
|
|
30
|
-
|
|
31
|
-
// if (typeof BigInt64Array !== 'undefined') {
|
|
32
|
-
// TYPED_ARRAY_TO_TYPE.BigInt64Array = new Int64();
|
|
33
|
-
// TYPED_ARRAY_TO_TYPE.BigUint64Array = new Uint64();
|
|
34
|
-
// }
|
|
35
|
-
|
|
36
|
-
export function deduceTypeFromColumn(
|
|
37
|
-
value: unknown
|
|
38
|
-
): StringConstructor | DateConstructor | Float32ArrayConstructor | null {
|
|
39
|
-
if (value instanceof Date) {
|
|
40
|
-
return Date;
|
|
41
|
-
} else if (value instanceof Number) {
|
|
42
|
-
return Float32Array;
|
|
43
|
-
} else if (typeof value === 'string') {
|
|
44
|
-
return String;
|
|
45
|
-
}
|
|
46
|
-
return null;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export function deduceTypeFromValue(
|
|
50
|
-
value: unknown
|
|
51
|
-
): StringConstructor | DateConstructor | Float32ArrayConstructor | null {
|
|
52
|
-
if (value instanceof Date) {
|
|
53
|
-
return Date;
|
|
54
|
-
} else if (value instanceof Number) {
|
|
55
|
-
return Float32Array;
|
|
56
|
-
} else if (typeof value === 'string') {
|
|
57
|
-
return String;
|
|
58
|
-
}
|
|
59
|
-
return null;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
/*
|
|
63
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
64
|
-
function deduceSchema(rows) {
|
|
65
|
-
const row = rows[0];
|
|
66
|
-
|
|
67
|
-
const schema = {};
|
|
68
|
-
let i = 0;
|
|
69
|
-
for (const columnName in row) {
|
|
70
|
-
const value = row[columnName];
|
|
71
|
-
switch (typeof value) {
|
|
72
|
-
case 'number':
|
|
73
|
-
case 'boolean':
|
|
74
|
-
// TODO - booleans could be handled differently...
|
|
75
|
-
schema[columnName] = {name: String(columnName), index: i, type: Float32Array};
|
|
76
|
-
break;
|
|
77
|
-
|
|
78
|
-
case 'object':
|
|
79
|
-
schema[columnName] = {name: String(columnName), index: i, type: Array};
|
|
80
|
-
break;
|
|
81
|
-
|
|
82
|
-
case 'string':
|
|
83
|
-
default:
|
|
84
|
-
schema[columnName] = {name: String(columnName), index: i, type: Array};
|
|
85
|
-
// We currently only handle numeric rows
|
|
86
|
-
// TODO we could offer a function to map strings to numbers?
|
|
87
|
-
}
|
|
88
|
-
i++;
|
|
89
|
-
}
|
|
90
|
-
return schema;
|
|
91
|
-
}
|
|
92
|
-
*/
|
package/src/types.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/** Any typed array */
|
|
2
|
-
export type TypedArray =
|
|
3
|
-
| Int8Array
|
|
4
|
-
| Uint8Array
|
|
5
|
-
| Int16Array
|
|
6
|
-
| Uint16Array
|
|
7
|
-
| Int32Array
|
|
8
|
-
| Uint32Array
|
|
9
|
-
| Uint8ClampedArray
|
|
10
|
-
| Float32Array
|
|
11
|
-
| Float64Array;
|
|
12
|
-
|
|
13
|
-
export type BigTypedArray = TypedArray | BigInt64Array | BigUint64Array;
|
|
14
|
-
|
|
15
|
-
/** Any numeric array: typed array or `number[]` */
|
|
16
|
-
export type NumberArray = number[] | TypedArray;
|
|
17
|
-
|
|
18
|
-
/** Any array: typed array or js array (`any[]`) */
|
|
19
|
-
export type AnyArray = any[] | TypedArray;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|