@loaders.gl/arrow 3.0.13 → 3.0.14

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.
@@ -10,12 +10,12 @@ var _apacheArrow = require("apache-arrow");
10
10
  function parseArrowSync(arrayBuffer, options) {
11
11
  var _options$arrow;
12
12
 
13
- const arrowTable = _apacheArrow.Table.from([new Uint8Array(arrayBuffer)]);
13
+ var arrowTable = _apacheArrow.Table.from([new Uint8Array(arrayBuffer)]);
14
14
 
15
- const columnarTable = {};
16
- arrowTable.schema.fields.forEach(field => {
17
- const arrowColumn = arrowTable.getColumn(field.name);
18
- const values = arrowColumn.toArray();
15
+ var columnarTable = {};
16
+ arrowTable.schema.fields.forEach(function (field) {
17
+ var arrowColumn = arrowTable.getColumn(field.name);
18
+ var values = arrowColumn.toArray();
19
19
  columnarTable[field.name] = values;
20
20
  });
21
21
 
@@ -33,15 +33,15 @@ function parseArrowSync(arrayBuffer, options) {
33
33
  }
34
34
 
35
35
  function convertColumnarToRowFormatTable(columnarTable) {
36
- const tableKeys = Object.keys(columnarTable);
37
- const tableRowsCount = columnarTable[tableKeys[0]].length;
38
- const rowFormatTable = [];
36
+ var tableKeys = Object.keys(columnarTable);
37
+ var tableRowsCount = columnarTable[tableKeys[0]].length;
38
+ var rowFormatTable = [];
39
39
 
40
- for (let index = 0; index < tableRowsCount; index++) {
41
- const tableItem = {};
40
+ for (var index = 0; index < tableRowsCount; index++) {
41
+ var tableItem = {};
42
42
 
43
- for (let keyIndex = 0; keyIndex < tableKeys.length; keyIndex++) {
44
- const fieldName = tableKeys[keyIndex];
43
+ for (var keyIndex = 0; keyIndex < tableKeys.length; keyIndex++) {
44
+ var fieldName = tableKeys[keyIndex];
45
45
  tableItem[fieldName] = columnarTable[fieldName][index];
46
46
  }
47
47
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/lib/parse-arrow-sync.ts"],"names":["parseArrowSync","arrayBuffer","options","arrowTable","Table","from","Uint8Array","columnarTable","schema","fields","forEach","field","arrowColumn","getColumn","name","values","toArray","arrow","shape","convertColumnarToRowFormatTable","tableKeys","Object","keys","tableRowsCount","length","rowFormatTable","index","tableItem","keyIndex","fieldName","push"],"mappings":";;;;;;;AACA;;AAGe,SAASA,cAAT,CAAwBC,WAAxB,EAAqCC,OAArC,EAAmE;AAAA;;AAChF,QAAMC,UAAU,GAAGC,mBAAMC,IAAN,CAAW,CAAC,IAAIC,UAAJ,CAAeL,WAAf,CAAD,CAAX,CAAnB;;AAMA,QAAMM,aAAa,GAAG,EAAtB;AAEAJ,EAAAA,UAAU,CAACK,MAAX,CAAkBC,MAAlB,CAAyBC,OAAzB,CAAkCC,KAAD,IAAW;AAE1C,UAAMC,WAAW,GAAGT,UAAU,CAACU,SAAX,CAAqBF,KAAK,CAACG,IAA3B,CAApB;AACA,UAAMC,MAAM,GAAGH,WAAW,CAACI,OAAZ,EAAf;AACAT,IAAAA,aAAa,CAACI,KAAK,CAACG,IAAP,CAAb,GAA4BC,MAA5B;AACD,GALD;;AAOA,UAAQb,OAAR,aAAQA,OAAR,yCAAQA,OAAO,CAAEe,KAAjB,mDAAQ,eAAgBC,KAAxB;AACE,SAAK,aAAL;AACE,aAAOf,UAAP;;AACF,SAAK,kBAAL;AACE,aAAOgB,+BAA+B,CAACZ,aAAD,CAAtC;;AACF,SAAK,gBAAL;AACA;AACE,aAAOA,aAAP;AAPJ;AASD;;AAED,SAASY,+BAAT,CAAyCZ,aAAzC,EAAwD;AACtD,QAAMa,SAAS,GAAGC,MAAM,CAACC,IAAP,CAAYf,aAAZ,CAAlB;AACA,QAAMgB,cAAc,GAAGhB,aAAa,CAACa,SAAS,CAAC,CAAD,CAAV,CAAb,CAA4BI,MAAnD;AACA,QAAMC,cAAoB,GAAG,EAA7B;;AAEA,OAAK,IAAIC,KAAK,GAAG,CAAjB,EAAoBA,KAAK,GAAGH,cAA5B,EAA4CG,KAAK,EAAjD,EAAqD;AACnD,UAAMC,SAAS,GAAG,EAAlB;;AACA,SAAK,IAAIC,QAAQ,GAAG,CAApB,EAAuBA,QAAQ,GAAGR,SAAS,CAACI,MAA5C,EAAoDI,QAAQ,EAA5D,EAAgE;AAC9D,YAAMC,SAAS,GAAGT,SAAS,CAACQ,QAAD,CAA3B;AACAD,MAAAA,SAAS,CAACE,SAAD,CAAT,GAAuBtB,aAAa,CAACsB,SAAD,CAAb,CAAyBH,KAAzB,CAAvB;AACD;;AACDD,IAAAA,cAAc,CAACK,IAAf,CAAoBH,SAApB;AACD;;AACD,SAAOF,cAAP;AACD","sourcesContent":["import type {ArrowLoaderOptions} from '../arrow-loader';\nimport {Table} from 'apache-arrow';\n\n// Parses arrow to a columnar table\nexport default function parseArrowSync(arrayBuffer, options?: ArrowLoaderOptions) {\n const arrowTable = Table.from([new Uint8Array(arrayBuffer)]);\n\n // Extract columns\n\n // TODO - avoid calling `getColumn` on columns we are not interested in?\n // Add options object?\n const columnarTable = {};\n\n arrowTable.schema.fields.forEach((field) => {\n // This (is intended to) coalesce all record batches into a single typed array\n const arrowColumn = arrowTable.getColumn(field.name);\n const values = arrowColumn.toArray();\n columnarTable[field.name] = values;\n });\n\n switch (options?.arrow?.shape) {\n case 'arrow-table':\n return arrowTable;\n case 'object-row-table':\n return convertColumnarToRowFormatTable(columnarTable);\n case 'columnar-table':\n default:\n return columnarTable;\n }\n}\n\nfunction convertColumnarToRowFormatTable(columnarTable) {\n const tableKeys = Object.keys(columnarTable);\n const tableRowsCount = columnarTable[tableKeys[0]].length;\n const rowFormatTable: {}[] = [];\n\n for (let index = 0; index < tableRowsCount; index++) {\n const tableItem = {};\n for (let keyIndex = 0; keyIndex < tableKeys.length; keyIndex++) {\n const fieldName = tableKeys[keyIndex];\n tableItem[fieldName] = columnarTable[fieldName][index];\n }\n rowFormatTable.push(tableItem);\n }\n return rowFormatTable;\n}\n"],"file":"parse-arrow-sync.js"}
1
+ {"version":3,"sources":["../../../src/lib/parse-arrow-sync.ts"],"names":["parseArrowSync","arrayBuffer","options","arrowTable","Table","from","Uint8Array","columnarTable","schema","fields","forEach","field","arrowColumn","getColumn","name","values","toArray","arrow","shape","convertColumnarToRowFormatTable","tableKeys","Object","keys","tableRowsCount","length","rowFormatTable","index","tableItem","keyIndex","fieldName","push"],"mappings":";;;;;;;AACA;;AAGe,SAASA,cAAT,CAAwBC,WAAxB,EAAqCC,OAArC,EAAmE;AAAA;;AAChF,MAAMC,UAAU,GAAGC,mBAAMC,IAAN,CAAW,CAAC,IAAIC,UAAJ,CAAeL,WAAf,CAAD,CAAX,CAAnB;;AAMA,MAAMM,aAAa,GAAG,EAAtB;AAEAJ,EAAAA,UAAU,CAACK,MAAX,CAAkBC,MAAlB,CAAyBC,OAAzB,CAAiC,UAACC,KAAD,EAAW;AAE1C,QAAMC,WAAW,GAAGT,UAAU,CAACU,SAAX,CAAqBF,KAAK,CAACG,IAA3B,CAApB;AACA,QAAMC,MAAM,GAAGH,WAAW,CAACI,OAAZ,EAAf;AACAT,IAAAA,aAAa,CAACI,KAAK,CAACG,IAAP,CAAb,GAA4BC,MAA5B;AACD,GALD;;AAOA,UAAQb,OAAR,aAAQA,OAAR,yCAAQA,OAAO,CAAEe,KAAjB,mDAAQ,eAAgBC,KAAxB;AACE,SAAK,aAAL;AACE,aAAOf,UAAP;;AACF,SAAK,kBAAL;AACE,aAAOgB,+BAA+B,CAACZ,aAAD,CAAtC;;AACF,SAAK,gBAAL;AACA;AACE,aAAOA,aAAP;AAPJ;AASD;;AAED,SAASY,+BAAT,CAAyCZ,aAAzC,EAAwD;AACtD,MAAMa,SAAS,GAAGC,MAAM,CAACC,IAAP,CAAYf,aAAZ,CAAlB;AACA,MAAMgB,cAAc,GAAGhB,aAAa,CAACa,SAAS,CAAC,CAAD,CAAV,CAAb,CAA4BI,MAAnD;AACA,MAAMC,cAAoB,GAAG,EAA7B;;AAEA,OAAK,IAAIC,KAAK,GAAG,CAAjB,EAAoBA,KAAK,GAAGH,cAA5B,EAA4CG,KAAK,EAAjD,EAAqD;AACnD,QAAMC,SAAS,GAAG,EAAlB;;AACA,SAAK,IAAIC,QAAQ,GAAG,CAApB,EAAuBA,QAAQ,GAAGR,SAAS,CAACI,MAA5C,EAAoDI,QAAQ,EAA5D,EAAgE;AAC9D,UAAMC,SAAS,GAAGT,SAAS,CAACQ,QAAD,CAA3B;AACAD,MAAAA,SAAS,CAACE,SAAD,CAAT,GAAuBtB,aAAa,CAACsB,SAAD,CAAb,CAAyBH,KAAzB,CAAvB;AACD;;AACDD,IAAAA,cAAc,CAACK,IAAf,CAAoBH,SAApB;AACD;;AACD,SAAOF,cAAP;AACD","sourcesContent":["import type {ArrowLoaderOptions} from '../arrow-loader';\nimport {Table} from 'apache-arrow';\n\n// Parses arrow to a columnar table\nexport default function parseArrowSync(arrayBuffer, options?: ArrowLoaderOptions) {\n const arrowTable = Table.from([new Uint8Array(arrayBuffer)]);\n\n // Extract columns\n\n // TODO - avoid calling `getColumn` on columns we are not interested in?\n // Add options object?\n const columnarTable = {};\n\n arrowTable.schema.fields.forEach((field) => {\n // This (is intended to) coalesce all record batches into a single typed array\n const arrowColumn = arrowTable.getColumn(field.name);\n const values = arrowColumn.toArray();\n columnarTable[field.name] = values;\n });\n\n switch (options?.arrow?.shape) {\n case 'arrow-table':\n return arrowTable;\n case 'object-row-table':\n return convertColumnarToRowFormatTable(columnarTable);\n case 'columnar-table':\n default:\n return columnarTable;\n }\n}\n\nfunction convertColumnarToRowFormatTable(columnarTable) {\n const tableKeys = Object.keys(columnarTable);\n const tableRowsCount = columnarTable[tableKeys[0]].length;\n const rowFormatTable: {}[] = [];\n\n for (let index = 0; index < tableRowsCount; index++) {\n const tableItem = {};\n for (let keyIndex = 0; keyIndex < tableKeys.length; keyIndex++) {\n const fieldName = tableKeys[keyIndex];\n tableItem[fieldName] = columnarTable[fieldName][index];\n }\n rowFormatTable.push(tableItem);\n }\n return rowFormatTable;\n}\n"],"file":"parse-arrow-sync.js"}
package/dist/es5/types.js CHANGED
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.VECTOR_TYPES = void 0;
7
- let VECTOR_TYPES;
7
+ var VECTOR_TYPES;
8
8
  exports.VECTOR_TYPES = VECTOR_TYPES;
9
9
 
10
10
  (function (VECTOR_TYPES) {
@@ -1,4 +1,4 @@
1
- const VERSION = typeof "3.0.13" !== 'undefined' ? "3.0.13" : 'latest';
1
+ const VERSION = typeof "3.0.14" !== 'undefined' ? "3.0.14" : 'latest';
2
2
  const DEFAULT_ARROW_LOADER_OPTIONS = {
3
3
  arrow: {
4
4
  shape: 'columnar-table'
@@ -1,5 +1,5 @@
1
1
  import { encodeArrowSync } from './lib/encode-arrow';
2
- const VERSION = typeof "3.0.13" !== 'undefined' ? "3.0.13" : 'latest';
2
+ const VERSION = typeof "3.0.14" !== 'undefined' ? "3.0.14" : 'latest';
3
3
  export const ArrowWriter = {
4
4
  name: 'Apache Arrow',
5
5
  id: 'arrow',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loaders.gl/arrow",
3
- "version": "3.0.13",
3
+ "version": "3.0.14",
4
4
  "description": "Simple columnar table loader for the Apache Arrow format",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -36,10 +36,10 @@
36
36
  "build-worker": "webpack --entry ./src/workers/arrow-worker.ts --output ./dist/arrow-worker.js --config ../../scripts/webpack/worker.js"
37
37
  },
38
38
  "dependencies": {
39
- "@loaders.gl/core": "3.0.13",
40
- "@loaders.gl/loader-utils": "3.0.13",
41
- "@loaders.gl/schema": "3.0.13",
39
+ "@loaders.gl/core": "3.0.14",
40
+ "@loaders.gl/loader-utils": "3.0.14",
41
+ "@loaders.gl/schema": "3.0.14",
42
42
  "apache-arrow": "^4.0.0"
43
43
  },
44
- "gitHead": "acb7e5ecb4fc82e3628a2cf47a5345e8d28c0c2a"
44
+ "gitHead": "dc931768fc34de549ef6baeb94e2ee5aa8163baf"
45
45
  }