@loaders.gl/parquet 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.
- package/dist/dist.es5.min.js +1 -1
- package/dist/dist.es5.min.js.map +1 -1
- package/dist/dist.min.js +1 -1
- package/dist/dist.min.js.map +1 -1
- package/dist/es5/bundle.js +2 -2
- package/dist/es5/bundle.js.map +1 -1
- package/dist/es5/index.js +9 -9
- package/dist/es5/parquet-loader.js +70 -19
- package/dist/es5/parquet-loader.js.map +1 -1
- package/dist/es5/parquet-writer.js +4 -4
- package/dist/es5/parquet-writer.js.map +1 -1
- package/dist/es5/parquetjs/codecs/index.js +6 -4
- package/dist/es5/parquetjs/codecs/index.js.map +1 -1
- package/dist/es5/parquetjs/codecs/plain.js +43 -41
- package/dist/es5/parquetjs/codecs/plain.js.map +1 -1
- package/dist/es5/parquetjs/codecs/rle.js +35 -25
- package/dist/es5/parquetjs/codecs/rle.js.map +1 -1
- package/dist/es5/parquetjs/compression.js +9 -7
- package/dist/es5/parquetjs/compression.js.map +1 -1
- package/dist/es5/parquetjs/file.js +15 -15
- package/dist/es5/parquetjs/file.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/BoundaryOrder.js +1 -1
- package/dist/es5/parquetjs/parquet-thrift/BsonType.js +45 -31
- package/dist/es5/parquetjs/parquet-thrift/BsonType.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/ColumnChunk.js +152 -141
- package/dist/es5/parquetjs/parquet-thrift/ColumnChunk.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/ColumnIndex.js +160 -147
- package/dist/es5/parquetjs/parquet-thrift/ColumnIndex.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/ColumnMetaData.js +259 -248
- package/dist/es5/parquetjs/parquet-thrift/ColumnMetaData.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/ColumnOrder.js +79 -67
- package/dist/es5/parquetjs/parquet-thrift/ColumnOrder.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/CompressionCodec.js +1 -1
- package/dist/es5/parquetjs/parquet-thrift/ConvertedType.js +1 -1
- package/dist/es5/parquetjs/parquet-thrift/DataPageHeader.js +124 -113
- package/dist/es5/parquetjs/parquet-thrift/DataPageHeader.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/DataPageHeaderV2.js +169 -158
- package/dist/es5/parquetjs/parquet-thrift/DataPageHeaderV2.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/DateType.js +45 -31
- package/dist/es5/parquetjs/parquet-thrift/DateType.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/DecimalType.js +79 -68
- package/dist/es5/parquetjs/parquet-thrift/DecimalType.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/DictionaryPageHeader.js +94 -83
- package/dist/es5/parquetjs/parquet-thrift/DictionaryPageHeader.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/Encoding.js +1 -1
- package/dist/es5/parquetjs/parquet-thrift/EnumType.js +45 -31
- package/dist/es5/parquetjs/parquet-thrift/EnumType.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/FieldRepetitionType.js +1 -1
- package/dist/es5/parquetjs/parquet-thrift/FileMetaData.js +182 -170
- package/dist/es5/parquetjs/parquet-thrift/FileMetaData.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/IndexPageHeader.js +45 -31
- package/dist/es5/parquetjs/parquet-thrift/IndexPageHeader.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/IntType.js +79 -68
- package/dist/es5/parquetjs/parquet-thrift/IntType.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/JsonType.js +45 -31
- package/dist/es5/parquetjs/parquet-thrift/JsonType.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/KeyValue.js +79 -68
- package/dist/es5/parquetjs/parquet-thrift/KeyValue.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/ListType.js +45 -31
- package/dist/es5/parquetjs/parquet-thrift/ListType.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/LogicalType.js +343 -319
- package/dist/es5/parquetjs/parquet-thrift/LogicalType.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/MapType.js +45 -31
- package/dist/es5/parquetjs/parquet-thrift/MapType.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/MicroSeconds.js +45 -31
- package/dist/es5/parquetjs/parquet-thrift/MicroSeconds.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/MilliSeconds.js +45 -31
- package/dist/es5/parquetjs/parquet-thrift/MilliSeconds.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/NullType.js +45 -31
- package/dist/es5/parquetjs/parquet-thrift/NullType.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/OffsetIndex.js +75 -64
- package/dist/es5/parquetjs/parquet-thrift/OffsetIndex.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/PageEncodingStats.js +94 -83
- package/dist/es5/parquetjs/parquet-thrift/PageEncodingStats.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/PageHeader.js +169 -158
- package/dist/es5/parquetjs/parquet-thrift/PageHeader.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/PageLocation.js +94 -83
- package/dist/es5/parquetjs/parquet-thrift/PageLocation.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/PageType.js +1 -1
- package/dist/es5/parquetjs/parquet-thrift/RowGroup.js +124 -113
- package/dist/es5/parquetjs/parquet-thrift/RowGroup.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/SchemaElement.js +199 -188
- package/dist/es5/parquetjs/parquet-thrift/SchemaElement.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/SortingColumn.js +94 -83
- package/dist/es5/parquetjs/parquet-thrift/SortingColumn.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/Statistics.js +135 -124
- package/dist/es5/parquetjs/parquet-thrift/Statistics.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/StringType.js +45 -31
- package/dist/es5/parquetjs/parquet-thrift/StringType.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/TimeType.js +79 -68
- package/dist/es5/parquetjs/parquet-thrift/TimeType.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/TimeUnit.js +101 -88
- package/dist/es5/parquetjs/parquet-thrift/TimeUnit.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/TimestampType.js +79 -68
- package/dist/es5/parquetjs/parquet-thrift/TimestampType.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/Type.js +1 -1
- package/dist/es5/parquetjs/parquet-thrift/TypeDefinedOrder.js +45 -31
- package/dist/es5/parquetjs/parquet-thrift/TypeDefinedOrder.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/UUIDType.js +45 -31
- package/dist/es5/parquetjs/parquet-thrift/UUIDType.js.map +1 -1
- package/dist/es5/parquetjs/parquet-thrift/index.js +43 -43
- package/dist/es5/parquetjs/reader.js +813 -276
- package/dist/es5/parquetjs/reader.js.map +1 -1
- package/dist/es5/parquetjs/schema/declare.js +11 -9
- package/dist/es5/parquetjs/schema/declare.js.map +1 -1
- package/dist/es5/parquetjs/schema/schema.js +87 -73
- package/dist/es5/parquetjs/schema/schema.js.map +1 -1
- package/dist/es5/parquetjs/schema/shred.js +95 -55
- package/dist/es5/parquetjs/schema/shred.js.map +1 -1
- package/dist/es5/parquetjs/schema/types.js +25 -25
- package/dist/es5/parquetjs/schema/types.js.map +1 -1
- package/dist/es5/parquetjs/util.js +71 -39
- package/dist/es5/parquetjs/util.js.map +1 -1
- package/dist/es5/parquetjs/writer.js +467 -200
- package/dist/es5/parquetjs/writer.js.map +1 -1
- package/dist/esm/parquet-loader.js +1 -1
- package/dist/esm/parquet-writer.js +1 -1
- package/dist/parquet-worker.js +1 -1
- package/dist/parquet-worker.js.map +1 -1
- package/package.json +4 -4
package/dist/dist.min.js
CHANGED
|
@@ -47,5 +47,5 @@ object-assign
|
|
|
47
47
|
* limitations under the License.
|
|
48
48
|
*
|
|
49
49
|
*/
|
|
50
|
-
!function(e){"use strict";"function"==typeof bootstrap?bootstrap("promise",e):t.exports=e()}((function(){"use strict";var t=!1;try{throw new Error}catch(e){t=!!e.stack}var i,n=E(),o=function(){},s=function(){var t={task:void 0,next:null},i=t,n=!1,o=void 0,a=!1,u=[];function f(){for(var e,r;t.next;)e=(t=t.next).task,t.task=void 0,(r=t.domain)&&(t.domain=void 0,r.enter()),l(e,r);for(;u.length;)l(e=u.pop());n=!1}function l(t,e){try{t()}catch(t){if(a)throw e&&e.exit(),setTimeout(f,0),e&&e.enter(),t;setTimeout((function(){throw t}),0)}e&&e.exit()}if(s=function(t){i=i.next={task:t,domain:a&&e.domain,next:null},n||(n=!0,o())},"object"==typeof e&&"[object process]"===e.toString()&&e.nextTick)a=!0,o=function(){e.nextTick(f)};else if("function"==typeof r)o="undefined"!=typeof window?r.bind(window,f):function(){r(f)};else if("undefined"!=typeof MessageChannel){var c=new MessageChannel;c.port1.onmessage=function(){o=h,c.port1.onmessage=f,f()};var h=function(){c.port2.postMessage(0)};o=function(){setTimeout(f,0),h()}}else o=function(){setTimeout(f,0)};return s.runAfter=function(t){u.push(t),n||(n=!0,o())},s}(),a=Function.call;function u(t){return function(){return a.apply(t,arguments)}}var f,l=u(Array.prototype.slice),c=u(Array.prototype.reduce||function(t,e){var r=0,i=this.length;if(1===arguments.length)for(;;){if(r in this){e=this[r++];break}if(++r>=i)throw new TypeError}for(;r<i;r++)r in this&&(e=t(e,this[r],r));return e}),h=u(Array.prototype.indexOf||function(t){for(var e=0;e<this.length;e++)if(this[e]===t)return e;return-1}),d=u(Array.prototype.map||function(t,e){var r=this,i=[];return c(r,(function(n,o,s){i.push(t.call(e,o,s,r))}),void 0),i}),p=Object.create||function(t){function e(){}return e.prototype=t,new e},_=Object.defineProperty||function(t,e,r){return t[e]=r.value,t},y=u(Object.prototype.hasOwnProperty),w=Object.keys||function(t){var e=[];for(var r in t)y(t,r)&&e.push(r);return e},g=u(Object.prototype.toString);function T(t){return"[object StopIteration]"===g(t)||t instanceof f}f="undefined"!=typeof ReturnValue?ReturnValue:function(t){this.value=t};function v(e,r){if(t&&r.stack&&"object"==typeof e&&null!==e&&e.stack){for(var i=[],n=r;n;n=n.source)n.stack&&(!e.__minimumStackCounter__||e.__minimumStackCounter__>n.stackCounter)&&(_(e,"__minimumStackCounter__",{value:n.stackCounter,configurable:!0}),i.unshift(n.stack));i.unshift(e.stack);var o=function(t){for(var e=t.split("\n"),r=[],i=0;i<e.length;++i){var n=e[i];!b(n)&&(-1===(o=n).indexOf("(module.js:")&&-1===o.indexOf("(node.js:"))&&n&&r.push(n)}var o;return r.join("\n")}(i.join("\nFrom previous event:\n"));_(e,"stack",{value:o,configurable:!0})}}function m(t){var e=/at .+ \((.+):(\d+):(?:\d+)\)$/.exec(t);if(e)return[e[1],Number(e[2])];var r=/at ([^ ]+):(\d+):(?:\d+)$/.exec(t);if(r)return[r[1],Number(r[2])];var i=/.*@(.+):(\d+)$/.exec(t);return i?[i[1],Number(i[2])]:void 0}function b(t){var e=m(t);if(!e)return!1;var r=e[0],o=e[1];return r===i&&o>=n&&o<=H}function E(){if(t)try{throw new Error}catch(t){var e=t.stack.split("\n"),r=m(e[0].indexOf("@")>0?e[1]:e[2]);if(!r)return;return i=r[0],r[1]}}function S(t){return t instanceof k?t:L(t)?function(t){var e=N();return S.nextTick((function(){try{t.then(e.resolve,e.reject,e.notify)}catch(t){e.reject(t)}})),e.promise}(t):q(t)}S.resolve=S,S.nextTick=s,S.longStackSupport=!1;var B=1;function N(){var e,r=[],i=[],n=p(N.prototype),o=p(k.prototype);if(o.promiseDispatch=function(t,n,o){var s=l(arguments);r?(r.push(s),"when"===n&&o[1]&&i.push(o[1])):S.nextTick((function(){e.promiseDispatch.apply(e,s)}))},o.valueOf=function(){if(r)return o;var t=R(e);return x(t)&&(e=t),t},o.inspect=function(){return e?e.inspect():{state:"pending"}},S.longStackSupport&&t)try{throw new Error}catch(t){o.stack=t.stack.substring(t.stack.indexOf("\n")+1),o.stackCounter=B++}function s(n){e=n,S.longStackSupport&&t&&(o.source=n),c(r,(function(t,e){S.nextTick((function(){n.promiseDispatch.apply(n,e)}))}),void 0),r=void 0,i=void 0}return n.promise=o,n.resolve=function(t){e||s(S(t))},n.fulfill=function(t){e||s(q(t))},n.reject=function(t){e||s(W(t))},n.notify=function(t){e||c(i,(function(e,r){S.nextTick((function(){r(t)}))}),void 0)},n}function I(t){if("function"!=typeof t)throw new TypeError("resolver must be a function.");var e=N();try{t(e.resolve,e.reject,e.notify)}catch(t){e.reject(t)}return e.promise}function O(t){return I((function(e,r){for(var i=0,n=t.length;i<n;i++)S(t[i]).then(e,r)}))}function k(t,e,r){void 0===e&&(e=function(t){return W(new Error("Promise does not support operation: "+t))}),void 0===r&&(r=function(){return{state:"unknown"}});var i=p(k.prototype);if(i.promiseDispatch=function(r,n,o){var s;try{s=t[n]?t[n].apply(i,o):e.call(i,n,o)}catch(t){s=W(t)}r&&r(s)},i.inspect=r,r){var n=r();"rejected"===n.state&&(i.exception=n.reason),i.valueOf=function(){var t=r();return"pending"===t.state||"rejected"===t.state?i:t.value}}return i}function A(t,e,r,i){return S(t).then(e,r,i)}function R(t){if(x(t)){var e=t.inspect();if("fulfilled"===e.state)return e.value}return t}function x(t){return t instanceof k}function L(t){return(e=t)===Object(e)&&"function"==typeof t.then;var e}"object"==typeof e&&e&&e.env&&e.env.Q_DEBUG&&(S.longStackSupport=!0),S.defer=N,N.prototype.makeNodeResolver=function(){var t=this;return function(e,r){e?t.reject(e):arguments.length>2?t.resolve(l(arguments,1)):t.resolve(r)}},S.Promise=I,S.promise=I,I.race=O,I.all=V,I.reject=W,I.resolve=S,S.passByCopy=function(t){return t},k.prototype.passByCopy=function(){return this},S.join=function(t,e){return S(t).join(e)},k.prototype.join=function(t){return S([this,t]).spread((function(t,e){if(t===e)return t;throw new Error("Q can't join: not the same: "+t+" "+e)}))},S.race=O,k.prototype.race=function(){return this.then(S.race)},S.makePromise=k,k.prototype.toString=function(){return"[object Promise]"},k.prototype.then=function(t,e,r){var i=this,n=N(),o=!1;return S.nextTick((function(){i.promiseDispatch((function(e){o||(o=!0,n.resolve(function(e){try{return"function"==typeof t?t(e):e}catch(t){return W(t)}}(e)))}),"when",[function(t){o||(o=!0,n.resolve(function(t){if("function"==typeof e){v(t,i);try{return e(t)}catch(t){return W(t)}}return W(t)}(t)))}])})),i.promiseDispatch(void 0,"when",[void 0,function(t){var e,i=!1;try{e=function(t){return"function"==typeof r?r(t):t}(t)}catch(t){if(i=!0,!S.onerror)throw t;S.onerror(t)}i||n.notify(e)}]),n.promise},S.tap=function(t,e){return S(t).tap(e)},k.prototype.tap=function(t){return t=S(t),this.then((function(e){return t.fcall(e).thenResolve(e)}))},S.when=A,k.prototype.thenResolve=function(t){return this.then((function(){return t}))},S.thenResolve=function(t,e){return S(t).thenResolve(e)},k.prototype.thenReject=function(t){return this.then((function(){throw t}))},S.thenReject=function(t,e){return S(t).thenReject(e)},S.nearer=R,S.isPromise=x,S.isPromiseAlike=L,S.isPending=function(t){return x(t)&&"pending"===t.inspect().state},k.prototype.isPending=function(){return"pending"===this.inspect().state},S.isFulfilled=function(t){return!x(t)||"fulfilled"===t.inspect().state},k.prototype.isFulfilled=function(){return"fulfilled"===this.inspect().state},S.isRejected=function(t){return x(t)&&"rejected"===t.inspect().state},k.prototype.isRejected=function(){return"rejected"===this.inspect().state};var P,M,U,D=[],F=[],C=[],j=!0;function z(){D.length=0,F.length=0,j||(j=!0)}function W(t){var r=k({when:function(r){return r&&function(t){if(j){var r=h(F,t);-1!==r&&("object"==typeof e&&"function"==typeof e.emit&&S.nextTick.runAfter((function(){var i=h(C,t);-1!==i&&(e.emit("rejectionHandled",D[r],t),C.splice(i,1))})),F.splice(r,1),D.splice(r,1))}}(this),r?r(t):this}},(function(){return this}),(function(){return{state:"rejected",reason:t}}));return function(t,r){j&&("object"==typeof e&&"function"==typeof e.emit&&S.nextTick.runAfter((function(){-1!==h(F,t)&&(e.emit("unhandledRejection",r,t),C.push(t))})),F.push(t),r&&void 0!==r.stack?D.push(r.stack):D.push("(no stack) "+r))}(r,t),r}function q(t){return k({when:function(){return t},get:function(e){return t[e]},set:function(e,r){t[e]=r},delete:function(e){delete t[e]},post:function(e,r){return null==e?t.apply(void 0,r):t[e].apply(t,r)},apply:function(e,r){return t.apply(e,r)},keys:function(){return w(t)}},void 0,(function(){return{state:"fulfilled",value:t}}))}function Y(t,e,r){return S(t).spread(e,r)}function Z(t,e,r){return S(t).dispatch(e,r)}function V(t){return A(t,(function(t){var e=0,r=N();return c(t,(function(i,n,o){var s;x(n)&&"fulfilled"===(s=n.inspect()).state?t[o]=s.value:(++e,A(n,(function(i){t[o]=i,0==--e&&r.resolve(t)}),r.reject,(function(t){r.notify({index:o,value:t})})))}),void 0),0===e&&r.resolve(t),r.promise}))}function G(t){if(0===t.length)return S.resolve();var e=S.defer(),r=0;return c(t,(function(i,n,o){var s=t[o];r++,A(s,(function(t){e.resolve(t)}),(function(t){if(0===--r){var i=t||new Error(""+t);i.message="Q can't get fulfillment value from any promise, all promises were rejected. Last error message: "+i.message,e.reject(i)}}),(function(t){e.notify({index:o,value:t})}))}),void 0),e.promise}function K(t){return A(t,(function(t){return t=d(t,S),A(V(d(t,(function(t){return A(t,o,o)}))),(function(){return t}))}))}S.resetUnhandledRejections=z,S.getUnhandledReasons=function(){return D.slice()},S.stopUnhandledRejectionTracking=function(){z(),j=!1},z(),S.reject=W,S.fulfill=q,S.master=function(t){return k({isDef:function(){}},(function(e,r){return Z(t,e,r)}),(function(){return S(t).inspect()}))},S.spread=Y,k.prototype.spread=function(t,e){return this.all().then((function(e){return t.apply(void 0,e)}),e)},S.async=function(t){return function(){function e(t,e){var o;if("undefined"==typeof StopIteration){try{o=r[t](e)}catch(t){return W(t)}return o.done?S(o.value):A(o.value,i,n)}try{o=r[t](e)}catch(t){return T(t)?S(t.value):W(t)}return A(o,i,n)}var r=t.apply(this,arguments),i=e.bind(e,"next"),n=e.bind(e,"throw");return i()}},S.spawn=function(t){S.done(S.async(t)())},S.return=function(t){throw new f(t)},S.promised=function(t){return function(){return Y([this,V(arguments)],(function(e,r){return t.apply(e,r)}))}},S.dispatch=Z,k.prototype.dispatch=function(t,e){var r=this,i=N();return S.nextTick((function(){r.promiseDispatch(i.resolve,t,e)})),i.promise},S.get=function(t,e){return S(t).dispatch("get",[e])},k.prototype.get=function(t){return this.dispatch("get",[t])},S.set=function(t,e,r){return S(t).dispatch("set",[e,r])},k.prototype.set=function(t,e){return this.dispatch("set",[t,e])},S.del=S.delete=function(t,e){return S(t).dispatch("delete",[e])},k.prototype.del=k.prototype.delete=function(t){return this.dispatch("delete",[t])},S.mapply=S.post=function(t,e,r){return S(t).dispatch("post",[e,r])},k.prototype.mapply=k.prototype.post=function(t,e){return this.dispatch("post",[t,e])},S.send=S.mcall=S.invoke=function(t,e){return S(t).dispatch("post",[e,l(arguments,2)])},k.prototype.send=k.prototype.mcall=k.prototype.invoke=function(t){return this.dispatch("post",[t,l(arguments,1)])},S.fapply=function(t,e){return S(t).dispatch("apply",[void 0,e])},k.prototype.fapply=function(t){return this.dispatch("apply",[void 0,t])},S.try=S.fcall=function(t){return S(t).dispatch("apply",[void 0,l(arguments,1)])},k.prototype.fcall=function(){return this.dispatch("apply",[void 0,l(arguments)])},S.fbind=function(t){var e=S(t),r=l(arguments,1);return function(){return e.dispatch("apply",[this,r.concat(l(arguments))])}},k.prototype.fbind=function(){var t=this,e=l(arguments);return function(){return t.dispatch("apply",[this,e.concat(l(arguments))])}},S.keys=function(t){return S(t).dispatch("keys",[])},k.prototype.keys=function(){return this.dispatch("keys",[])},S.all=V,k.prototype.all=function(){return V(this)},S.any=G,k.prototype.any=function(){return G(this)},S.allResolved=(P=K,M="allResolved",U="allSettled",function(){return"undefined"!=typeof console&&"function"==typeof console.warn&&console.warn(M+" is deprecated, use "+U+" instead.",new Error("").stack),P.apply(P,arguments)}),k.prototype.allResolved=function(){return K(this)},S.allSettled=function(t){return S(t).allSettled()},k.prototype.allSettled=function(){return this.then((function(t){return V(d(t,(function(t){function e(){return t.inspect()}return(t=S(t)).then(e,e)})))}))},S.fail=S.catch=function(t,e){return S(t).then(void 0,e)},k.prototype.fail=k.prototype.catch=function(t){return this.then(void 0,t)},S.progress=function(t,e){return S(t).then(void 0,void 0,e)},k.prototype.progress=function(t){return this.then(void 0,void 0,t)},S.fin=S.finally=function(t,e){return S(t).finally(e)},k.prototype.fin=k.prototype.finally=function(t){if(!t||"function"!=typeof t.apply)throw new Error("Q can't apply finally callback");return t=S(t),this.then((function(e){return t.fcall().then((function(){return e}))}),(function(e){return t.fcall().then((function(){throw e}))}))},S.done=function(t,e,r,i){return S(t).done(e,r,i)},k.prototype.done=function(t,r,i){var n=function(t){S.nextTick((function(){if(v(t,o),!S.onerror)throw t;S.onerror(t)}))},o=t||r||i?this.then(t,r,i):this;"object"==typeof e&&e&&e.domain&&(n=e.domain.bind(n)),o.then(void 0,n)},S.timeout=function(t,e,r){return S(t).timeout(e,r)},k.prototype.timeout=function(t,e){var r=N(),i=setTimeout((function(){e&&"string"!=typeof e||((e=new Error(e||"Timed out after "+t+" ms")).code="ETIMEDOUT"),r.reject(e)}),t);return this.then((function(t){clearTimeout(i),r.resolve(t)}),(function(t){clearTimeout(i),r.reject(t)}),r.notify),r.promise},S.delay=function(t,e){return void 0===e&&(e=t,t=void 0),S(t).delay(e)},k.prototype.delay=function(t){return this.then((function(e){var r=N();return setTimeout((function(){r.resolve(e)}),t),r.promise}))},S.nfapply=function(t,e){return S(t).nfapply(e)},k.prototype.nfapply=function(t){var e=N(),r=l(t);return r.push(e.makeNodeResolver()),this.fapply(r).fail(e.reject),e.promise},S.nfcall=function(t){var e=l(arguments,1);return S(t).nfapply(e)},k.prototype.nfcall=function(){var t=l(arguments),e=N();return t.push(e.makeNodeResolver()),this.fapply(t).fail(e.reject),e.promise},S.nfbind=S.denodeify=function(t){if(void 0===t)throw new Error("Q can't wrap an undefined function");var e=l(arguments,1);return function(){var r=e.concat(l(arguments)),i=N();return r.push(i.makeNodeResolver()),S(t).fapply(r).fail(i.reject),i.promise}},k.prototype.nfbind=k.prototype.denodeify=function(){var t=l(arguments);return t.unshift(this),S.denodeify.apply(void 0,t)},S.nbind=function(t,e){var r=l(arguments,2);return function(){var i=r.concat(l(arguments)),n=N();function o(){return t.apply(e,arguments)}return i.push(n.makeNodeResolver()),S(o).fapply(i).fail(n.reject),n.promise}},k.prototype.nbind=function(){var t=l(arguments,0);return t.unshift(this),S.nbind.apply(void 0,t)},S.nmapply=S.npost=function(t,e,r){return S(t).npost(e,r)},k.prototype.nmapply=k.prototype.npost=function(t,e){var r=l(e||[]),i=N();return r.push(i.makeNodeResolver()),this.dispatch("post",[t,r]).fail(i.reject),i.promise},S.nsend=S.nmcall=S.ninvoke=function(t,e){var r=l(arguments,2),i=N();return r.push(i.makeNodeResolver()),S(t).dispatch("post",[e,r]).fail(i.reject),i.promise},k.prototype.nsend=k.prototype.nmcall=k.prototype.ninvoke=function(t){var e=l(arguments,1),r=N();return e.push(r.makeNodeResolver()),this.dispatch("post",[t,e]).fail(r.reject),r.promise},S.nodeify=function(t,e){return S(t).nodeify(e)},k.prototype.nodeify=function(t){if(!t)return this;this.then((function(e){S.nextTick((function(){t(null,e)}))}),(function(e){S.nextTick((function(){t(e)}))}))},S.noConflict=function(){throw new Error("Q.noConflict only works when Q is used as a global")};var H=E();return S}))}).call(this,r(5),r(51).setImmediate)},function(t,e,r){var i=r(4),n=r(8);function o(t,e,r){function o(t,r,i){e.call(this,t,r,i)}return i.inherits(o,e),o.prototype.writeMessageBegin=function(e,i,s){i==n.MessageType.CALL||i==n.MessageType.ONEWAY?(r.seqId2Service[s]=t,o.super_.prototype.writeMessageBegin.call(this,t+":"+e,i,s)):o.super_.prototype.writeMessageBegin.call(this,e,i,s)},o}function s(){this.seqid=0}e.Multiplexer=s,s.prototype.createClient=function(t,e,r){e.Client&&(e=e.Client);var i=new e(new r.transport(void 0,(function(t,e){r.write(t,e)})),new o(t,r.protocol,r)),n=this;return i.new_seqid=function(){return n.seqid+=1,n.seqid},"object"!=typeof r.client&&(r.client={}),r.client[t]=i,i}},function(t,e,r){var i=r(38),n=r(10),o=r(57);function s(t,e){this.inBuf=t||new Buffer(0),this.outBuffers=[],this.outCount=0,this.readPos=0,this.onFlush=e}t.exports=s,s.prototype=new o,s.receiver=function(t,e){var r=null;return function(n){for(r&&(n=Buffer.concat([r,n]),r=null);n.length;){if(n.length<4)return void(r=n);var o=i.readI32(n,0);if(n.length<4+o)return void(r=n);var a=n.slice(4,4+o);r=n.slice(4+o),t(new s(a),e),n=r,r=null}}},s.prototype.commitPosition=function(){},s.prototype.rollbackPosition=function(){},s.prototype.isOpen=function(){return!0},s.prototype.open=function(){},s.prototype.close=function(){},s.prototype.setCurrSeqId=function(t){this._seqid=t},s.prototype.ensureAvailable=function(t){if(this.readPos+t>this.inBuf.length)throw new n},s.prototype.read=function(t){this.ensureAvailable(t);var e=this.readPos+t;if(this.inBuf.length<e)throw new Error("read("+t+") failed - not enough data");var r=this.inBuf.slice(this.readPos,e);return this.readPos=e,r},s.prototype.readByte=function(){return this.ensureAvailable(1),i.readByte(this.inBuf[this.readPos++])},s.prototype.readI16=function(){this.ensureAvailable(2);var t=i.readI16(this.inBuf,this.readPos);return this.readPos+=2,t},s.prototype.readI32=function(){this.ensureAvailable(4);var t=i.readI32(this.inBuf,this.readPos);return this.readPos+=4,t},s.prototype.readDouble=function(){this.ensureAvailable(8);var t=i.readDouble(this.inBuf,this.readPos);return this.readPos+=8,t},s.prototype.readString=function(t){this.ensureAvailable(t);var e=this.inBuf.toString("utf8",this.readPos,this.readPos+t);return this.readPos+=t,e},s.prototype.borrow=function(){return{buf:this.inBuf,readIndex:this.readPos,writeIndex:this.inBuf.length}},s.prototype.consume=function(t){this.readPos+=t},s.prototype.write=function(t,e){"string"==typeof t&&(t=new Buffer(t,e||"utf8")),this.outBuffers.push(t),this.outCount+=t.length},s.prototype.flush=function(){var t=this._seqid;this._seqid=null;var e=new Buffer(this.outCount),r=0;if(this.outBuffers.forEach((function(t){t.copy(e,r,0),r+=t.length})),this.onFlush){var n=new Buffer(e.length+4);i.writeI32(n,e.length),e.copy(n,4,0,e.length),this.onFlush&&this.onFlush(n,t)}this.outBuffers=[],this.outCount=0}},function(t,e,r){var i=r(39);function n(t){this.__reset(t)}t.exports=n,n.prototype.__reset=function(t){this.url=t,this.socket=null,this.callbacks=[],this.send_pending=[],this.send_buf="",this.recv_buf="",this.rb_wpos=0,this.rb_rpos=0},n.prototype.flush=function(t,e){var r,i=this;this.isOpen()?(this.socket.send(this.send_buf),this.callbacks.push((r=e,function(t){i.setRecvBuffer(t),r()}))):this.send_pending.push({buf:this.send_buf,cb:e})},n.prototype.__onOpen=function(){var t=this;this.send_pending.length>0&&(this.send_pending.forEach((function(e){var r;t.socket.send(e.buf),t.callbacks.push((r=e.cb,function(e){t.setRecvBuffer(e),r()}))})),this.send_pending=[])},n.prototype.__onClose=function(t){this.__reset(this.url)},n.prototype.__onMessage=function(t){this.callbacks.length&&this.callbacks.shift()(t.data)},n.prototype.__onError=function(t){i.error("websocket: "+t.toString()),this.socket.close()},n.prototype.setRecvBuffer=function(t){this.recv_buf=t,this.recv_buf_sz=this.recv_buf.length,this.wpos=this.recv_buf.length,this.rpos=0},n.prototype.isOpen=function(){return this.socket&&this.socket.readyState==this.socket.OPEN},n.prototype.open=function(){this.socket&&this.socket.readyState!=this.socket.CLOSED||(this.socket=new WebSocket(this.url),this.socket.onopen=this.__onOpen.bind(this),this.socket.onmessage=this.__onMessage.bind(this),this.socket.onerror=this.__onError.bind(this),this.socket.onclose=this.__onClose.bind(this))},n.prototype.close=function(){this.socket.close()},n.prototype.read=function(t){var e=this.wpos-this.rpos;if(0===e)return"";var r=t;e<t&&(r=e);var i=this.read_buf.substr(this.rpos,r);return this.rpos+=r,i},n.prototype.readAll=function(){return this.recv_buf},n.prototype.write=function(t){this.send_buf=t},n.prototype.getSendBuffer=function(){return this.send_buf}},function(t,e,r){"use strict";r.r(e),r.d(e,"ParquetReader",(function(){return K})),r.d(e,"ParquetEnvelopeReader",(function(){return H})),r.d(e,"ParquetWriter",(function(){return ht})),r.d(e,"ParquetEnvelopeWriter",(function(){return dt})),r.d(e,"ParquetTransformer",(function(){return pt})),r.d(e,"ParquetSchema",(function(){return U})),r.d(e,"ParquetLoader",(function(){return gt})),r.d(e,"ParquetWorkerLoader",(function(){return wt})),r.d(e,"_ParquetWriter",(function(){return Tt}));var i=r(12),n=r.n(i);var o=r(18),s=r.n(o);function a(t,e,r){const i=r.bitWidth;if(e%8!=0)throw new Error("must be a multiple of 8");const n=new Array(e).fill(0);for(let r=0;r<i*e;r++)t.buffer[t.offset+Math.floor(r/8)]&1<<r%8&&(n[Math.floor(r/i)]|=1<<r%i);return t.offset+=i*(e/8),n}function u(t,e,r){const i=r.bitWidth;let n=0;for(let e=0;e<Math.ceil(i/8);e++)n<<=8,n+=t.buffer[t.offset],t.offset+=1;return new Array(e).fill(n)}function f(t,e){const r=e.bitWidth;for(let e=0;e<t.length%8;e++)t.push(0);const i=Buffer.alloc(Math.ceil(r*(t.length/8)));for(let e=0;e<r*t.length;e++)(t[Math.floor(e/r)]&1<<e%r)>0&&(i[Math.floor(e/8)]|=1<<e%8);return Buffer.concat([Buffer.from(s.a.encode(t.length/8<<1|1)),i])}function l(t,e,r){const i=r.bitWidth,n=Buffer.alloc(Math.ceil(i/8));for(let e=0;e<n.length;e++)n.writeUInt8(255&t,e),t>>=8;return Buffer.concat([Buffer.from(s.a.encode(e<<1)),n])}const c={PLAIN:{encodeValues:function(t,e,r){switch(t){case"BOOLEAN":return function(t){const e=Buffer.alloc(Math.ceil(t.length/8));e.fill(0);for(let r=0;r<t.length;r++)t[r]&&(e[Math.floor(r/8)]|=1<<r%8);return e}(e);case"INT32":return function(t){const e=Buffer.alloc(4*t.length);for(let r=0;r<t.length;r++)e.writeInt32LE(t[r],4*r);return e}(e);case"INT64":return function(t){const e=Buffer.alloc(8*t.length);for(let r=0;r<t.length;r++)n.a.writeInt64LE(t[r],e,8*r);return e}(e);case"INT96":return function(t){const e=Buffer.alloc(12*t.length);for(let r=0;r<t.length;r++)t[r]>=0?(n.a.writeInt64LE(t[r],e,12*r),e.writeUInt32LE(0,12*r+8)):(n.a.writeInt64LE(1+~-t[r],e,12*r),e.writeUInt32LE(4294967295,12*r+8));return e}(e);case"FLOAT":return function(t){const e=Buffer.alloc(4*t.length);for(let r=0;r<t.length;r++)e.writeFloatLE(t[r],4*r);return e}(e);case"DOUBLE":return function(t){const e=Buffer.alloc(8*t.length);for(let r=0;r<t.length;r++)e.writeDoubleLE(t[r],8*r);return e}(e);case"BYTE_ARRAY":return function(t){let e=0;for(let r=0;r<t.length;r++)t[r]=Buffer.from(t[r]),e+=4+t[r].length;const r=Buffer.alloc(e);let i=0;for(let e=0;e<t.length;e++)r.writeUInt32LE(t[e].length,i),t[e].copy(r,i+4),i+=4+t[e].length;return r}(e);case"FIXED_LEN_BYTE_ARRAY":return function(t,e){if(!e.typeLength)throw new Error("missing option: typeLength (required for FIXED_LEN_BYTE_ARRAY)");for(let r=0;r<t.length;r++)if(t[r]=Buffer.from(t[r]),t[r].length!==e.typeLength)throw new Error("invalid value for FIXED_LEN_BYTE_ARRAY: "+t[r]);return Buffer.concat(t)}(e,r);default:throw new Error("unsupported type: "+t)}},decodeValues:function(t,e,r,i){switch(t){case"BOOLEAN":return function(t,e){const r=[];for(let i=0;i<e;i++){const e=t.buffer[t.offset+Math.floor(i/8)];r.push((e&1<<i%8)>0)}return t.offset+=Math.ceil(e/8),r}(e,r);case"INT32":return function(t,e){const r=[];for(let i=0;i<e;i++)r.push(t.buffer.readInt32LE(t.offset)),t.offset+=4;return r}(e,r);case"INT64":return function(t,e){const r=[];for(let i=0;i<e;i++)r.push(n.a.readInt64LE(t.buffer,t.offset)),t.offset+=8;return r}(e,r);case"INT96":return function(t,e){const r=[];for(let i=0;i<e;i++){const e=n.a.readInt64LE(t.buffer,t.offset);4294967295===t.buffer.readUInt32LE(t.offset+8)?r.push(1+~-e):r.push(e),t.offset+=12}return r}(e,r);case"FLOAT":return function(t,e){const r=[];for(let i=0;i<e;i++)r.push(t.buffer.readFloatLE(t.offset)),t.offset+=4;return r}(e,r);case"DOUBLE":return function(t,e){const r=[];for(let i=0;i<e;i++)r.push(t.buffer.readDoubleLE(t.offset)),t.offset+=8;return r}(e,r);case"BYTE_ARRAY":return function(t,e){const r=[];for(let i=0;i<e;i++){const e=t.buffer.readUInt32LE(t.offset);t.offset+=4,r.push(t.buffer.slice(t.offset,t.offset+e)),t.offset+=e}return r}(e,r);case"FIXED_LEN_BYTE_ARRAY":return function(t,e,r){const i=[];if(!r.typeLength)throw new Error("missing option: typeLength (required for FIXED_LEN_BYTE_ARRAY)");for(let n=0;n<e;n++)i.push(t.buffer.slice(t.offset,t.offset+r.typeLength)),t.offset+=r.typeLength;return i}(e,r,i);default:throw new Error("unsupported type: "+t)}}},RLE:{encodeValues:function(t,e,r){if(!("bitWidth"in r))throw new Error("bitWidth is required");switch(t){case"BOOLEAN":case"INT32":case"INT64":e=e.map(t=>parseInt(t,10));break;default:throw new Error("unsupported type: "+t)}let i=Buffer.alloc(0),n=[],o=0;for(let t=0;t<e.length;t++)0===o&&n.length%8==0&&e[t]===e[t+1]?(n.length&&(i=Buffer.concat([i,f(n,r)]),n=[]),o=1):o>0&&e[t]===e[t-1]?o+=1:(o&&(i=Buffer.concat([i,l(e[t-1],o,r)]),o=0),n.push(e[t]));if(o?i=Buffer.concat([i,l(e[e.length-1],o,r)]):n.length&&(i=Buffer.concat([i,f(n,r)])),r.disableEnvelope)return i;const s=Buffer.alloc(i.length+4);return s.writeUInt32LE(i.length,void 0),i.copy(s,4),s},decodeValues:function(t,e,r,i){if(!("bitWidth"in i))throw new Error("bitWidth is required");i.disableEnvelope||(e.offset+=4);let n=[];for(;n.length<r;){const t=s.a.decode(e.buffer,e.offset);if(e.offset+=s.a.encodingLength(t),1&t){const r=8*(t>>1);n.push(...a(e,r,i))}else{const r=t>>1;n.push(...u(e,r,i))}}if(n=n.slice(0,r),n.length!==r)throw new Error("invalid RLE encoding");return n}}};var h=r(1),d=r(42),p=r.n(d),_=r(43),y=r.n(_);let w,g,T;const v={UNCOMPRESSED:{deflate:function(t){return t},inflate:function(t){return t}},GZIP:{deflate:function(t){return p.a.gzipSync(t)},inflate:function(t){return p.a.gunzipSync(t)}},SNAPPY:{deflate:function(t){return y.a.compress(t)},inflate:function(t){return y.a.uncompress(t)}},LZO:{deflate:function(t){return g=g||h.j("lzo"),g.compress(t)},inflate:function(t,e){return g=g||h.j("lzo"),g.decompress(t,e)}},BROTLI:{deflate:function(t){w=w||h.j("brotli");const e=w.compress(t,{mode:0,quality:8,lgwin:22});return e?Buffer.from(e):Buffer.alloc(0)},inflate:function(t){if(w=w||h.j("brotli"),!t.length)return Buffer.alloc(0);return Buffer.from(w.decompress(t))}},LZ4:{deflate:function(t){T=T||h.j("lz4js");try{return Buffer.from(T.compress(t))}catch(t){throw t}},inflate:function(t,e){T=T||h.j("lz4js");try{return Buffer.from(T.decompress(t,e))}catch(t){throw t}}}};function m(t,e){if(!(t in v))throw new Error("invalid compression method: "+t);return v[t].deflate(e)}function b(t,e,r){if(!(t in v))throw new Error("invalid compression method: "+t);return v[t].inflate(e,r)}var E=r(41),S=r.n(E);const B={BOOLEAN:{primitiveType:"BOOLEAN",toPrimitive:function(t){return Boolean(t)},fromPrimitive:function(t){return Boolean(t)}},INT32:{primitiveType:"INT32",toPrimitive:O},INT64:{primitiveType:"INT64",toPrimitive:k},INT96:{primitiveType:"INT96",toPrimitive:function(t){const e=parseInt(t,10);if(isNaN(e))throw new Error("invalid value for INT96: "+t);return e}},FLOAT:{primitiveType:"FLOAT",toPrimitive:function(t){const e=parseFloat(t);if(isNaN(e))throw new Error("invalid value for FLOAT: "+t);return e}},DOUBLE:{primitiveType:"DOUBLE",toPrimitive:function(t){const e=parseFloat(t);if(isNaN(e))throw new Error("invalid value for DOUBLE: "+t);return e}},BYTE_ARRAY:{primitiveType:"BYTE_ARRAY",toPrimitive:A},FIXED_LEN_BYTE_ARRAY:{primitiveType:"FIXED_LEN_BYTE_ARRAY",toPrimitive:A},UTF8:{primitiveType:"BYTE_ARRAY",originalType:"UTF8",toPrimitive:function(t){return Buffer.from(t,"utf8")},fromPrimitive:function(t){return t.toString()}},TIME_MILLIS:{primitiveType:"INT32",originalType:"TIME_MILLIS",toPrimitive:function(t){const e=parseInt(t,10);if(e<0||e>0x10000000000000000||isNaN(e))throw new Error("invalid value for TIME_MILLIS: "+t);return e}},TIME_MICROS:{primitiveType:"INT64",originalType:"TIME_MICROS",toPrimitive:function(t){const e=parseInt(t,10);if(e<0||isNaN(e))throw new Error("invalid value for TIME_MICROS: "+t);return e}},DATE:{primitiveType:"INT32",originalType:"DATE",toPrimitive:function(t){if(t instanceof Date)return t.getTime()/864e5;{const e=parseInt(t,10);if(e<0||isNaN(e))throw new Error("invalid value for DATE: "+t);return e}},fromPrimitive:function(t){return new Date(864e5*t)}},TIMESTAMP_MILLIS:{primitiveType:"INT64",originalType:"TIMESTAMP_MILLIS",toPrimitive:function(t){if(t instanceof Date)return t.getTime();{const e=parseInt(t,10);if(e<0||isNaN(e))throw new Error("invalid value for TIMESTAMP_MILLIS: "+t);return e}},fromPrimitive:function(t){return new Date(t)}},TIMESTAMP_MICROS:{primitiveType:"INT64",originalType:"TIMESTAMP_MICROS",toPrimitive:function(t){if(t instanceof Date)return 1e3*t.getTime();{const e=parseInt(t,10);if(e<0||isNaN(e))throw new Error("invalid value for TIMESTAMP_MICROS: "+t);return e}},fromPrimitive:function(t){return new Date(t/1e3)}},UINT_8:{primitiveType:"INT32",originalType:"UINT_8",toPrimitive:function(t){const e=parseInt(t,10);if(e<0||e>255||isNaN(e))throw new Error("invalid value for UINT8: "+t);return e}},UINT_16:{primitiveType:"INT32",originalType:"UINT_16",toPrimitive:function(t){const e=parseInt(t,10);if(e<0||e>65535||isNaN(e))throw new Error("invalid value for UINT16: "+t);return e}},UINT_32:{primitiveType:"INT32",originalType:"UINT_32",toPrimitive:function(t){const e=parseInt(t,10);if(e<0||e>0xffffffffffff||isNaN(e))throw new Error("invalid value for UINT32: "+t);return e}},UINT_64:{primitiveType:"INT64",originalType:"UINT_64",toPrimitive:function(t){const e=parseInt(t,10);if(e<0||isNaN(e))throw new Error("invalid value for UINT64: "+t);return e}},INT_8:{primitiveType:"INT32",originalType:"INT_8",toPrimitive:function(t){const e=parseInt(t,10);if(e<-128||e>127||isNaN(e))throw new Error("invalid value for INT8: "+t);return e}},INT_16:{primitiveType:"INT32",originalType:"INT_16",toPrimitive:function(t){const e=parseInt(t,10);if(e<-32768||e>32767||isNaN(e))throw new Error("invalid value for INT16: "+t);return e}},INT_32:{primitiveType:"INT32",originalType:"INT_32",toPrimitive:O},INT_64:{primitiveType:"INT64",originalType:"INT_64",toPrimitive:k},JSON:{primitiveType:"BYTE_ARRAY",originalType:"JSON",toPrimitive:function(t){return Buffer.from(JSON.stringify(t))},fromPrimitive:function(t){return JSON.parse(t)}},BSON:{primitiveType:"BYTE_ARRAY",originalType:"BSON",toPrimitive:function(t){return Buffer.from(S.a.serialize(t))},fromPrimitive:function(t){return S.a.deserialize(t)}},INTERVAL:{primitiveType:"FIXED_LEN_BYTE_ARRAY",originalType:"INTERVAL",typeLength:12,toPrimitive:function(t){if(!t.months||!t.days||!t.milliseconds)throw new Error("value for INTERVAL must be object { months: ..., days: ..., milliseconds: ... }");const e=Buffer.alloc(12);return e.writeUInt32LE(t.months,0),e.writeUInt32LE(t.days,4),e.writeUInt32LE(t.milliseconds,8),e},fromPrimitive:function(t){const e=Buffer.from(t),r=e.readUInt32LE(0),i=e.readUInt32LE(4),n=e.readUInt32LE(8);return{months:r,days:i,milliseconds:n}}}};function N(t,e){if(!(t in B))throw new Error("invalid type: "+t);return B[t].toPrimitive(e)}function I(t,e){if(!(t in B))throw new Error("invalid type: "+t);var r,i;return"fromPrimitive"in B[t]?null===(r=(i=B[t]).fromPrimitive)||void 0===r?void 0:r.call(i,e):e}function O(t){const e=parseInt(t,10);if(e<-2147483648||e>2147483647||isNaN(e))throw new Error("invalid value for INT32: "+t);return e}function k(t){const e=parseInt(t,10);if(isNaN(e))throw new Error("invalid value for INT64: "+t);return e}function A(t){return Buffer.from(t)}function R(t){const e={};for(const r of t.fieldList)e[r.key]={dlevels:[],rlevels:[],values:[],count:0};return{rowCount:0,columnData:e}}function x(t,e,r){const i=R(t).columnData;if(function t(e,r,i,n,o){for(const s in e){const a=e[s];let u=[];if(r&&a.name in r&&void 0!==r[a.name]&&null!==r[a.name]&&(r[a.name].constructor===Array?u=r[a.name]:u.push(r[a.name])),0===u.length&&Boolean(r)&&"REQUIRED"===a.repetitionType)throw new Error("missing required field: "+a.name);if(u.length>1&&"REPEATED"!==a.repetitionType)throw new Error("too many values for field: "+a.name);if(0!==u.length)for(let e=0;e<u.length;e++){const r=0===e?n:a.rLevelMax;a.isNested?t(a.fields,u[e],i,r,a.dLevelMax):(i[a.key].count+=1,i[a.key].rlevels.push(r),i[a.key].dlevels.push(a.dLevelMax),i[a.key].values.push(N(a.originalType||a.primitiveType,u[e])))}else a.isNested?t(a.fields,null,i,n,o):(i[a.key].count+=1,i[a.key].rlevels.push(n),i[a.key].dlevels.push(o))}}(t.fields,e,i,0,0),0===r.rowCount)return r.rowCount=1,void(r.columnData=i);r.rowCount+=1;for(const e of t.fieldList)Array.prototype.push.apply(r.columnData[e.key].rlevels,i[e.key].rlevels),Array.prototype.push.apply(r.columnData[e.key].dlevels,i[e.key].dlevels),Array.prototype.push.apply(r.columnData[e.key].values,i[e.key].values),r.columnData[e.key].count+=i[e.key].count}function L(t,e){const r=[];for(let t=0;t<e.rowCount;t++)r.push({});for(const i in e.columnData)P(t,e,i,r);return r}function P(t,e,r,i){const n=e.columnData[r];if(!n.count)return;const o=t.findField(r),s=t.findFieldBranch(r),a=new Array(o.rLevelMax+1).fill(0);let u=0;for(let t=0;t<n.count;t++){const e=n.dlevels[t],r=n.rlevels[t];a[r]++,a.fill(0,r+1);let f=0,l=i[a[f++]-1];for(const t of s){if(t===o)break;if(e<t.dLevelMax)break;if("REPEATED"===t.repetitionType){t.name in l||(l[t.name]=[]);const e=a[f++];for(;l[t.name].length<=e;)l[t.name].push({});l=l[t.name][e]}else l[t.name]=l[t.name]||{},l=l[t.name]}if(e===o.dLevelMax){const t=I(o.originalType||o.primitiveType,n.values[u]);if(u++,"REPEATED"===o.repetitionType){o.name in l||(l[o.name]=[]);const e=a[f];for(;l[o.name].length<=e;)l[o.name].push(null);l[o.name][e]=t}else l[o.name]=t}}}function M(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}class U{constructor(t){M(this,"schema",void 0),M(this,"fields",void 0),M(this,"fieldList",void 0),this.schema=t,this.fields=function t(e,r,i,n){const o={};for(const s in e){const a=e[s],u=!a.optional,f=Boolean(a.repeated);let l=r,h=i,d="REQUIRED";if(u||(d="OPTIONAL",h++),f&&(d="REPEATED",l++,u&&h++),a.fields){const e=n.concat([s]);o[s]={name:s,path:e,key:e.join(),repetitionType:d,rLevelMax:l,dLevelMax:h,isNested:!0,fieldCount:Object.keys(a.fields).length,fields:t(a.fields,l,h,e)};continue}const p=B[a.type];if(!p)throw new Error("invalid parquet type: "+a.type);if(a.encoding=a.encoding||"PLAIN",!(a.encoding in c))throw new Error("unsupported parquet encoding: "+a.encoding);if(a.compression=a.compression||"UNCOMPRESSED",!(a.compression in v))throw new Error("unsupported compression method: "+a.compression);const _=n.concat([s]);o[s]={name:s,primitiveType:p.primitiveType,originalType:p.originalType,path:_,key:_.join(),repetitionType:d,encoding:a.encoding,compression:a.compression,typeLength:a.typeLength||p.typeLength,rLevelMax:l,dLevelMax:h}}return o}(t,0,0,[]),this.fieldList=function t(e){let r=[];for(const i in e)r.push(e[i]),e[i].isNested&&(r=r.concat(t(e[i].fields)));return r}(this.fields)}findField(t){t="string"==typeof t?t.split(","):t.slice(0);let e=this.fields;for(;t.length>1;t.shift())e=e[t[0]].fields;return e[t[0]]}findFieldBranch(t){"string"==typeof t&&(t=t.split(","));const e=[];let r=this.fields;for(;t.length>0;t.shift())e.push(r[t[0]]),t.length>1&&(r=r[t[0]].fields);return e}shredRecord(t,e){x(this,t,e)}materializeRecords(t){return L(this,t)}compress(t){return D(this.schema,t),D(this.fields,t),this}buffer(){return R(this)}}function D(t,e){for(const r in t){const i=t[r];i.fields?D(i.fields,e):i.compression=e}}let F,C,j,z,W,q,Y,Z;function V(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}!function(t){t[t.BOOLEAN=0]="BOOLEAN",t[t.INT32=1]="INT32",t[t.INT64=2]="INT64",t[t.INT96=3]="INT96",t[t.FLOAT=4]="FLOAT",t[t.DOUBLE=5]="DOUBLE",t[t.BYTE_ARRAY=6]="BYTE_ARRAY",t[t.FIXED_LEN_BYTE_ARRAY=7]="FIXED_LEN_BYTE_ARRAY"}(F||(F={})),function(t){t[t.UNCOMPRESSED=0]="UNCOMPRESSED",t[t.SNAPPY=1]="SNAPPY",t[t.GZIP=2]="GZIP",t[t.LZO=3]="LZO",t[t.BROTLI=4]="BROTLI",t[t.LZ4=5]="LZ4",t[t.ZSTD=6]="ZSTD"}(C||(C={})),function(t){t[t.DATA_PAGE=0]="DATA_PAGE",t[t.INDEX_PAGE=1]="INDEX_PAGE",t[t.DICTIONARY_PAGE=2]="DICTIONARY_PAGE",t[t.DATA_PAGE_V2=3]="DATA_PAGE_V2"}(j||(j={})),function(t){t[t.PLAIN=0]="PLAIN",t[t.PLAIN_DICTIONARY=2]="PLAIN_DICTIONARY",t[t.RLE=3]="RLE",t[t.BIT_PACKED=4]="BIT_PACKED",t[t.DELTA_BINARY_PACKED=5]="DELTA_BINARY_PACKED",t[t.DELTA_LENGTH_BYTE_ARRAY=6]="DELTA_LENGTH_BYTE_ARRAY",t[t.DELTA_BYTE_ARRAY=7]="DELTA_BYTE_ARRAY",t[t.RLE_DICTIONARY=8]="RLE_DICTIONARY"}(z||(z={})),function(t){t[t.REQUIRED=0]="REQUIRED",t[t.OPTIONAL=1]="OPTIONAL",t[t.REPEATED=2]="REPEATED"}(W||(W={})),function(t){t[t.UTF8=0]="UTF8",t[t.MAP=1]="MAP",t[t.MAP_KEY_VALUE=2]="MAP_KEY_VALUE",t[t.LIST=3]="LIST",t[t.ENUM=4]="ENUM",t[t.DECIMAL=5]="DECIMAL",t[t.DATE=6]="DATE",t[t.TIME_MILLIS=7]="TIME_MILLIS",t[t.TIME_MICROS=8]="TIME_MICROS",t[t.TIMESTAMP_MILLIS=9]="TIMESTAMP_MILLIS",t[t.TIMESTAMP_MICROS=10]="TIMESTAMP_MICROS",t[t.UINT_8=11]="UINT_8",t[t.UINT_16=12]="UINT_16",t[t.UINT_32=13]="UINT_32",t[t.UINT_64=14]="UINT_64",t[t.INT_8=15]="INT_8",t[t.INT_16=16]="INT_16",t[t.INT_32=17]="INT_32",t[t.INT_64=18]="INT_64",t[t.JSON=19]="JSON",t[t.BSON=20]="BSON",t[t.INTERVAL=21]="INTERVAL"}(q||(q={}));Y=Symbol.asyncIterator;class G{constructor(t,e,r,i){V(this,"metadata",void 0),V(this,"envelopeReader",void 0),V(this,"schema",void 0),V(this,"columnList",void 0),V(this,"rowGroup",void 0),V(this,"rowGroupIndex",void 0),this.metadata=t,this.envelopeReader=e,this.schema=r,this.columnList=i,this.rowGroup=[],this.rowGroupIndex=0}async next(){if(0===this.rowGroup.length){if(this.rowGroupIndex>=this.metadata.row_groups.length)return null;const t=await this.envelopeReader.readRowGroup(this.schema,this.metadata.row_groups[this.rowGroupIndex],this.columnList);this.rowGroup=L(this.schema,t),this.rowGroupIndex++}return this.rowGroup.shift()}rewind(){this.rowGroup=[],this.rowGroupIndex=0}[Y](){let t=!1;return{next:async()=>{if(t)return{done:t,value:null};const e=await this.next();return null===e?{done:!0,value:e}:{done:!1,value:e}},return:async()=>(t=!0,{done:t,value:null}),throw:async()=>(t=!0,{done:!0,value:null})}}}Z=Symbol.asyncIterator;class K{static async openFile(t){const e=await H.openFile(t);try{await e.readHeader();const t=await e.readFooter();return new K(t,e)}catch(t){throw await e.close(),t}}static async openBuffer(t){const e=await H.openBuffer(t);try{await e.readHeader();const t=await e.readFooter();return new K(t,e)}catch(t){throw await e.close(),t}}static async openArrayBuffer(t){const e=t.byteLength,r=new H(async(e,r)=>Buffer.from(t,e,r),async()=>{},e);try{await r.readHeader();const t=await r.readFooter();return new K(t,r)}catch(t){throw await r.close(),t}}constructor(t,e){if(V(this,"metadata",void 0),V(this,"envelopeReader",void 0),V(this,"schema",void 0),1!==t.version)throw new Error("invalid parquet version");this.metadata=t,this.envelopeReader=e;const r=this.metadata.schema[0],{schema:i}=function t(e,r,i){const n={};let o=r;for(let r=0;r<i;r++){const r=e[o],i=o>0?h.i(W,r.repetition_type):"ROOT";let s=!1,a=!1;switch(i){case"REQUIRED":break;case"OPTIONAL":s=!0;break;case"REPEATED":a=!0;break;default:throw new Error("parquet: unknown repetition type")}if(r.num_children>0){const i=t(e,o+1,r.num_children);o=i.next,n[r.name]={optional:s,repeated:a,fields:i.schema}}else{let t=h.i(F,r.type);r.converted_type&&(t=h.i(q,r.converted_type)),n[r.name]={type:t,typeLength:r.type_length,optional:s,repeated:a},o++}}return{schema:n,offset:r,next:o}}(this.metadata.schema,1,r.num_children);this.schema=new U(i)}async close(){await this.envelopeReader.close()}getCursor(t){return t||(t=[]),t=t.map(t=>Array.isArray(t)?t:[t]),new G(this.metadata,this.envelopeReader,this.schema,t)}getRowCount(){return Number(this.metadata.num_rows)}getSchema(){return this.schema}getMetadata(){const t={};for(const e of this.metadata.key_value_metadata)t[e.key]=e.value;return t}[Z](){return this.getCursor()[Symbol.asyncIterator]()}}class H{static async openFile(t){const e=await h.g(t),r=await h.e(t),i=h.f.bind(void 0,r),n=h.c.bind(void 0,r);return new H(i,n,e.size)}static async openBuffer(t){return new H((e,r)=>Promise.resolve(t.slice(e,e+r)),()=>Promise.resolve(),t.length)}constructor(t,e,r){V(this,"read",void 0),V(this,"close",void 0),V(this,"fileSize",void 0),this.read=t,this.close=e,this.fileSize=r}async readHeader(){if("PAR1"!==(await this.read(0,"PAR1".length)).toString())throw new Error("not valid parquet file")}async readRowGroup(t,e,r){const i={rowCount:Number(e.num_rows),columnData:{}};for(const n of e.columns){const e=n.meta_data,o=null==e?void 0:e.path_in_schema;r.length>0&&h.d(r,o)<0||(i.columnData[o.join()]=await this.readColumnChunk(t,n))}return i}async readColumnChunk(t,e){var r,i,n,o,s;if(void 0!==e.file_path&&null!==e.file_path)throw new Error("external references are not supported");const a=t.findField(null===(r=e.meta_data)||void 0===r?void 0:r.path_in_schema),u=h.i(F,null===(i=e.meta_data)||void 0===i?void 0:i.type);if(u!==a.primitiveType)throw new Error("chunk type not matching schema: "+u);const f=h.i(C,null===(n=e.meta_data)||void 0===n?void 0:n.codec),l=Number(null===(o=e.meta_data)||void 0===o?void 0:o.data_page_offset),c=Number(null===(s=e.meta_data)||void 0===s?void 0:s.total_compressed_size);return function(t,e,r){const i={buffer:t,offset:0,size:t.length},n={rlevels:[],dlevels:[],values:[],count:0};for(;i.offset<i.size;){const{pageHeader:t,length:o}=h.b(i.buffer);i.offset+=o;const s=h.i(j,t.type);let a=null;switch(s){case"DATA_PAGE":a=J(i,t,e,r);break;case"DATA_PAGE_V2":a=$(i,t,e,r);break;default:throw new Error("invalid page type: "+s)}Array.prototype.push.apply(n.rlevels,a.rlevels),Array.prototype.push.apply(n.dlevels,a.dlevels),Array.prototype.push.apply(n.values,a.values),n.count+=a.count}return n}(await this.read(l,c),a,f)}async readFooter(){const t="PAR1".length+4,e=await this.read(this.fileSize-t,t);if("PAR1"!==e.slice(4).toString())throw new Error("not a valid parquet file");const r=e.readUInt32LE(0),i=this.fileSize-r-t;if(i<"PAR1".length)throw new Error("invalid metadata size");const n=await this.read(i,r),{metadata:o}=h.a(n);return o}}function X(t,e,r,i,n){if(!(e in c))throw new Error("invalid encoding: "+e);return c[e].decodeValues(t,r,i,n)}function J(t,e,r,i){var n,o,s,a;const u=t.offset+e.compressed_page_size,f=null===(n=e.data_page_header)||void 0===n?void 0:n.num_values;let l=t;if("UNCOMPRESSED"!==i){const r=b(i,t.buffer.slice(t.offset,u),e.uncompressed_page_size);l={buffer:r,offset:0,size:r.length},t.offset=u}const c=h.i(z,null===(o=e.data_page_header)||void 0===o?void 0:o.repetition_level_encoding);let d=new Array(f);r.rLevelMax>0?d=X("INT32",c,l,f,{bitWidth:h.h(r.rLevelMax),disableEnvelope:!1}):d.fill(0);const p=h.i(z,null===(s=e.data_page_header)||void 0===s?void 0:s.definition_level_encoding);let _=new Array(f);r.dLevelMax>0?_=X("INT32",p,l,f,{bitWidth:h.h(r.dLevelMax),disableEnvelope:!1}):_.fill(0);let y=0;for(const t of _)t===r.dLevelMax&&y++;const w=h.i(z,null===(a=e.data_page_header)||void 0===a?void 0:a.encoding);return{dlevels:_,rlevels:d,values:X(r.primitiveType,w,l,y,{typeLength:r.typeLength,bitWidth:r.typeLength}),count:f}}function $(t,e,r,i){var n,o,s,a;const u=t.offset+e.compressed_page_size,f=null===(n=e.data_page_header_v2)||void 0===n?void 0:n.num_values,l=f-(null===(o=e.data_page_header_v2)||void 0===o?void 0:o.num_nulls),c=h.i(z,null===(s=e.data_page_header_v2)||void 0===s?void 0:s.encoding);let d=new Array(f);r.rLevelMax>0?d=X("INT32","RLE",t,f,{bitWidth:h.h(r.rLevelMax),disableEnvelope:!0}):d.fill(0);let p=new Array(f);r.dLevelMax>0?p=X("INT32","RLE",t,f,{bitWidth:h.h(r.dLevelMax),disableEnvelope:!0}):p.fill(0);let _=t;if(null!==(a=e.data_page_header_v2)&&void 0!==a&&a.is_compressed){const r=b(i,t.buffer.slice(t.offset,u),e.uncompressed_page_size);_={buffer:r,offset:0,size:r.length},t.offset=u}return{dlevels:p,rlevels:d,values:X(r.primitiveType,c,_,l,{typeLength:r.typeLength,bitWidth:r.typeLength}),count:f}}var Q=r(40),tt=r(117),et=r(63),rt=r(64),it=r(67),nt=r(66),ot=r(62),st=r(116),at=r(24),ut=r(65),ft=r(2),lt=r.n(ft);function ct(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}class ht{static async openFile(t,e,r){const i=await h.l(e,r);return ht.openStream(t,i,r)}static async openStream(t,e,r){r||(r={});const i=await dt.openStream(t,e,r);return new ht(t,i,r)}constructor(t,e,r){ct(this,"schema",void 0),ct(this,"envelopeWriter",void 0),ct(this,"rowBuffer",void 0),ct(this,"rowGroupSize",void 0),ct(this,"closed",void 0),ct(this,"userMetadata",void 0),this.schema=t,this.envelopeWriter=e,this.rowBuffer={},this.rowGroupSize=r.rowGroupSize||4096,this.closed=!1,this.userMetadata={};try{e.writeHeader()}catch(t){throw e.close(),t}}async appendRow(t){if(this.closed)throw new Error("writer was closed");x(this.schema,t,this.rowBuffer),this.rowBuffer.rowCount>=this.rowGroupSize&&(this.rowBuffer={})}async close(t){if(this.closed)throw new Error("writer was closed");this.closed=!0,(this.rowBuffer.rowCount>0||this.rowBuffer.rowCount>=this.rowGroupSize)&&(this.rowBuffer={}),await this.envelopeWriter.writeFooter(this.userMetadata),await this.envelopeWriter.close(),t&&t()}setMetadata(t,e){this.userMetadata[String(t)]=String(e)}setRowGroupSize(t){this.rowGroupSize=t}setPageSize(t){this.envelopeWriter.setPageSize(t)}}class dt{static async openStream(t,e,r){const i=h.m.bind(void 0,e),n=h.k.bind(void 0,e);return new dt(t,i,n,0,r)}constructor(t,e,r,i,n){ct(this,"schema",void 0),ct(this,"write",void 0),ct(this,"close",void 0),ct(this,"offset",void 0),ct(this,"rowCount",void 0),ct(this,"rowGroups",void 0),ct(this,"pageSize",void 0),ct(this,"useDataPageV2",void 0),this.schema=t,this.write=e,this.close=r,this.offset=i,this.rowCount=0,this.rowGroups=[],this.pageSize=n.pageSize||8192,this.useDataPageV2="useDataPageV2"in n&&Boolean(n.useDataPageV2)}writeSection(t){return this.offset+=t.length,this.write(t)}writeHeader(){return this.writeSection(Buffer.from("PAR1"))}async writeRowGroup(t){const e=function(t,e,r){const i=new nt.a({num_rows:e.rowCount,columns:[],total_byte_size:0});let n=Buffer.alloc(0);for(const o of t.fieldList){if(o.isNested)continue;const t=yt(o,e,n.length,r),s=new ot.a({file_offset:t.metadataOffset,meta_data:t.metadata});i.columns.push(s),i.total_byte_size=new lt.a(Number(i.total_byte_size)+t.body.length),n=Buffer.concat([n,t.body])}return{body:n,metadata:i}}(this.schema,t,{baseOffset:this.offset,pageSize:this.pageSize,useDataPageV2:this.useDataPageV2});return this.rowCount+=t.rowCount,this.rowGroups.push(e.metadata),this.writeSection(e.body)}writeFooter(t){return t||(t={}),this.writeSection(function(t,e,r,i){const n=new st.a({version:1,created_by:"parquets",num_rows:e,row_groups:r,schema:[],key_value_metadata:[]});for(const t in i){var o,s;const e=new at.a({key:t,value:i[t]});null===(o=n.key_value_metadata)||void 0===o||null===(s=o.push)||void 0===s||s.call(o,e)}{const e=new ut.a({name:"root",num_children:Object.keys(t.fields).length});n.schema.push(e)}for(const e of t.fieldList){const t=W[e.repetitionType],r=new ut.a({name:e.name,repetition_type:t});e.isNested?r.num_children=e.fieldCount:r.type=F[e.primitiveType],e.originalType&&(r.converted_type=q[e.originalType]),r.type_length=e.typeLength,n.schema.push(r)}const a=h.n(n),u=Buffer.alloc(a.length+8);return a.copy(u),u.writeUInt32LE(a.length,a.length),u.write("PAR1",a.length+4),u}(this.schema,this.rowCount,this.rowGroups,t))}setPageSize(t){this.pageSize=t}}class pt extends Q.Transform{constructor(t,e={}){super({objectMode:!0}),ct(this,"writer",void 0);const r=(i=this,async function(t){i.push(t)});var i;this.writer=new ht(t,new dt(t,r,async()=>{},0,e),e)}_transform(t,e,r){return t?this.writer.appendRow(t).then(r):(r(),Promise.resolve())}async _flush(t){await this.writer.close(t)}}function _t(t,e,r,i){if(!(e in c))throw new Error("invalid encoding: "+e);return c[e].encodeValues(t,r,i)}function yt(t,e,r,i){const n=e.columnData[t.path.join()],o=(i.baseOffset||0)+r;let s,a=0,u=0;{let r;r=i.useDataPageV2?function(t,e,r){const i=_t(t.primitiveType,t.encoding,e.values,{typeLength:t.typeLength,bitWidth:t.typeLength}),n=m(t.compression,i);let o=Buffer.alloc(0);t.rLevelMax>0&&(o=_t("INT32","RLE",e.rlevels,{bitWidth:h.h(t.rLevelMax),disableEnvelope:!0}));let s=Buffer.alloc(0);t.dLevelMax>0&&(s=_t("INT32","RLE",e.dlevels,{bitWidth:h.h(t.dLevelMax),disableEnvelope:!0}));const a=new tt.a({type:j.DATA_PAGE_V2,data_page_header_v2:new rt.a({num_values:e.count,num_nulls:e.count-e.values.length,num_rows:r,encoding:z[t.encoding],definition_levels_byte_length:s.length,repetition_levels_byte_length:o.length,is_compressed:"UNCOMPRESSED"!==t.compression}),uncompressed_page_size:o.length+s.length+i.length,compressed_page_size:o.length+s.length+n.length}),u=h.n(a),f=Buffer.concat([u,o,s,n]);return{header:a,headerSize:u.length,page:f}}(t,n,e.rowCount):function(t,e){let r=Buffer.alloc(0);t.rLevelMax>0&&(r=_t("INT32","RLE",e.rlevels,{bitWidth:h.h(t.rLevelMax)}));let i=Buffer.alloc(0);t.dLevelMax>0&&(i=_t("INT32","RLE",e.dlevels,{bitWidth:h.h(t.dLevelMax)}));const n=_t(t.primitiveType,t.encoding,e.values,{typeLength:t.typeLength,bitWidth:t.typeLength}),o=Buffer.concat([r,i,n]),s=m(t.compression,o),a=new tt.a({type:j.DATA_PAGE,data_page_header:new et.a({num_values:e.count,encoding:z[t.encoding],definition_level_encoding:z.RLE,repetition_level_encoding:z.RLE}),uncompressed_page_size:o.length,compressed_page_size:s.length}),u=h.n(a),f=Buffer.concat([u,s]);return{header:a,headerSize:u.length,page:f}}(t,n),s=r.page,a+=r.header.uncompressed_page_size+r.headerSize,u+=r.header.compressed_page_size+r.headerSize}const f=new it.a({path_in_schema:t.path,num_values:n.count,data_page_offset:o,encodings:[],total_uncompressed_size:a,total_compressed_size:u,type:F[t.primitiveType],codec:C[t.compression]});f.encodings.push(z.RLE),f.encodings.push(z[t.encoding]);const l=o+s.length;return{body:Buffer.concat([s,h.n(f)]),metadata:f,metadataOffset:l}}const wt={name:"Apache Parquet",id:"parquet",module:"parquet",version:"3.0.13",worker:!0,category:"table",extensions:["parquet"],mimeTypes:["application/octet-stream"],binary:!0,options:{parquet:{type:"object-row-table",url:void 0}}},gt={...wt,parse:async function(t,e){const r=await K.openArrayBuffer(t),i=[];try{const t=r.getCursor();let e;for(;e=await t.next();)i.push(e)}finally{await r.close()}return i}};const Tt={name:"Apache Parquet",id:"parquet",module:"parquet",version:"3.0.13",extensions:["parquet"],mimeTypes:["application/octet-stream"],encodeSync:function(t,e){return new ArrayBuffer(0)},binary:!0,options:{}}},function(t,e,r){"use strict";r.d(e,"a",(function(){return h}));var i=r(2),n=r.n(i),o=r(0);class s{constructor(){}write(t){t.writeStructBegin("TypeDefinedOrder"),t.writeFieldStop(),t.writeStructEnd()}static read(t){for(t.readStructBegin();;){const e=t.readFieldBegin(),r=e.ftype;e.fid;if(r===o.Thrift.Type.STOP)break;t.skip(r),t.readFieldEnd()}return t.readStructEnd(),new s}}class a{constructor(t){var e,r,i;i=void 0,(r="TYPE_ORDER")in(e=this)?Object.defineProperty(e,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[r]=i;let n=0;if(null!=t){if(null!=t.TYPE_ORDER&&(n++,this.TYPE_ORDER=t.TYPE_ORDER),n>1)throw new o.Thrift.TProtocolException(o.Thrift.TProtocolExceptionType.INVALID_DATA,"Cannot read a TUnion with more than one set value!");if(n<1)throw new o.Thrift.TProtocolException(o.Thrift.TProtocolExceptionType.INVALID_DATA,"Cannot read a TUnion with no set value!")}}static fromTYPE_ORDER(t){return new a({TYPE_ORDER:t})}write(t){t.writeStructBegin("ColumnOrder"),null!=this.TYPE_ORDER&&(t.writeFieldBegin("TYPE_ORDER",o.Thrift.Type.STRUCT,1),this.TYPE_ORDER.write(t),t.writeFieldEnd()),t.writeFieldStop(),t.writeStructEnd()}static read(t){let e=0,r=null;for(t.readStructBegin();;){const i=t.readFieldBegin(),n=i.ftype,u=i.fid;if(n===o.Thrift.Type.STOP)break;switch(u){case 1:if(n===o.Thrift.Type.STRUCT){e++;const i=s.read(t);r=a.fromTYPE_ORDER(i)}else t.skip(n);break;default:t.skip(n)}t.readFieldEnd()}if(t.readStructEnd(),e>1)throw new o.Thrift.TProtocolException(o.Thrift.TProtocolExceptionType.INVALID_DATA,"Cannot read a TUnion with more than one set value!");if(e<1)throw new o.Thrift.TProtocolException(o.Thrift.TProtocolExceptionType.INVALID_DATA,"Cannot read a TUnion with no set value!");if(null!==r)return r;throw new o.Thrift.TProtocolException(o.Thrift.TProtocolExceptionType.UNKNOWN,"Unable to read data for TUnion")}}var u=r(24),f=r(66),l=r(65);function c(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}class h{constructor(t=null){if(c(this,"version",void 0),c(this,"schema",void 0),c(this,"num_rows",void 0),c(this,"row_groups",void 0),c(this,"key_value_metadata",void 0),c(this,"created_by",void 0),c(this,"column_orders",void 0),null==t||null==t.version)throw new o.Thrift.TProtocolException(o.Thrift.TProtocolExceptionType.UNKNOWN,"Required field[version] is unset!");if(this.version=t.version,null==t||null==t.schema)throw new o.Thrift.TProtocolException(o.Thrift.TProtocolExceptionType.UNKNOWN,"Required field[schema] is unset!");if(this.schema=t.schema,null==t||null==t.num_rows)throw new o.Thrift.TProtocolException(o.Thrift.TProtocolExceptionType.UNKNOWN,"Required field[num_rows] is unset!");if("number"==typeof t.num_rows?this.num_rows=new n.a(t.num_rows):this.num_rows=t.num_rows,null==t||null==t.row_groups)throw new o.Thrift.TProtocolException(o.Thrift.TProtocolExceptionType.UNKNOWN,"Required field[row_groups] is unset!");this.row_groups=t.row_groups,null!=t&&null!=t.key_value_metadata&&(this.key_value_metadata=t.key_value_metadata),null!=t&&null!=t.created_by&&(this.created_by=t.created_by),null!=t&&null!=t.column_orders&&(this.column_orders=t.column_orders)}write(t){t.writeStructBegin("FileMetaData"),null!=this.version&&(t.writeFieldBegin("version",o.Thrift.Type.I32,1),t.writeI32(this.version),t.writeFieldEnd()),null!=this.schema&&(t.writeFieldBegin("schema",o.Thrift.Type.LIST,2),t.writeListBegin(o.Thrift.Type.STRUCT,this.schema.length),this.schema.forEach(e=>{e.write(t)}),t.writeListEnd(),t.writeFieldEnd()),null!=this.num_rows&&(t.writeFieldBegin("num_rows",o.Thrift.Type.I64,3),t.writeI64(this.num_rows),t.writeFieldEnd()),null!=this.row_groups&&(t.writeFieldBegin("row_groups",o.Thrift.Type.LIST,4),t.writeListBegin(o.Thrift.Type.STRUCT,this.row_groups.length),this.row_groups.forEach(e=>{e.write(t)}),t.writeListEnd(),t.writeFieldEnd()),null!=this.key_value_metadata&&(t.writeFieldBegin("key_value_metadata",o.Thrift.Type.LIST,5),t.writeListBegin(o.Thrift.Type.STRUCT,this.key_value_metadata.length),this.key_value_metadata.forEach(e=>{e.write(t)}),t.writeListEnd(),t.writeFieldEnd()),null!=this.created_by&&(t.writeFieldBegin("created_by",o.Thrift.Type.STRING,6),t.writeString(this.created_by),t.writeFieldEnd()),null!=this.column_orders&&(t.writeFieldBegin("column_orders",o.Thrift.Type.LIST,7),t.writeListBegin(o.Thrift.Type.STRUCT,this.column_orders.length),this.column_orders.forEach(e=>{e.write(t)}),t.writeListEnd(),t.writeFieldEnd()),t.writeFieldStop(),t.writeStructEnd()}static read(t){t.readStructBegin();let e={};for(;;){const r=t.readFieldBegin(),i=r.ftype,n=r.fid;if(i===o.Thrift.Type.STOP)break;switch(n){case 1:if(i===o.Thrift.Type.I32){const r=t.readI32();e.version=r}else t.skip(i);break;case 2:if(i===o.Thrift.Type.LIST){const r=new Array,i=t.readListBegin().size;for(let e=0;e<i;e++){const e=l.a.read(t);r.push(e)}t.readListEnd(),e.schema=r}else t.skip(i);break;case 3:if(i===o.Thrift.Type.I64){const r=t.readI64();e.num_rows=r}else t.skip(i);break;case 4:if(i===o.Thrift.Type.LIST){const r=new Array,i=t.readListBegin().size;for(let e=0;e<i;e++){const e=f.a.read(t);r.push(e)}t.readListEnd(),e.row_groups=r}else t.skip(i);break;case 5:if(i===o.Thrift.Type.LIST){const r=new Array,i=t.readListBegin().size;for(let e=0;e<i;e++){const e=u.a.read(t);r.push(e)}t.readListEnd(),e.key_value_metadata=r}else t.skip(i);break;case 6:if(i===o.Thrift.Type.STRING){const r=t.readString();e.created_by=r}else t.skip(i);break;case 7:if(i===o.Thrift.Type.LIST){const r=new Array,i=t.readListBegin().size;for(let e=0;e<i;e++){const e=a.read(t);r.push(e)}t.readListEnd(),e.column_orders=r}else t.skip(i);break;default:t.skip(i)}t.readFieldEnd()}if(t.readStructEnd(),void 0!==e.version&&void 0!==e.schema&&void 0!==e.num_rows&&void 0!==e.row_groups)return new h(e);throw new o.Thrift.TProtocolException(o.Thrift.TProtocolExceptionType.UNKNOWN,"Unable to read FileMetaData from input")}}},function(t,e,r){"use strict";r.d(e,"a",(function(){return l}));var i=r(0),n=r(63),o=r(64);function s(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}class a{constructor(t){if(s(this,"num_values",void 0),s(this,"encoding",void 0),s(this,"is_sorted",void 0),null==t||null==t.num_values)throw new i.Thrift.TProtocolException(i.Thrift.TProtocolExceptionType.UNKNOWN,"Required field[num_values] is unset!");if(this.num_values=t.num_values,null==t||null==t.encoding)throw new i.Thrift.TProtocolException(i.Thrift.TProtocolExceptionType.UNKNOWN,"Required field[encoding] is unset!");this.encoding=t.encoding,null!=t&&null!=t.is_sorted&&(this.is_sorted=t.is_sorted)}write(t){t.writeStructBegin("DictionaryPageHeader"),null!=this.num_values&&(t.writeFieldBegin("num_values",i.Thrift.Type.I32,1),t.writeI32(this.num_values),t.writeFieldEnd()),null!=this.encoding&&(t.writeFieldBegin("encoding",i.Thrift.Type.I32,2),t.writeI32(this.encoding),t.writeFieldEnd()),null!=this.is_sorted&&(t.writeFieldBegin("is_sorted",i.Thrift.Type.BOOL,3),t.writeBool(this.is_sorted),t.writeFieldEnd()),t.writeFieldStop(),t.writeStructEnd()}static read(t){t.readStructBegin();let e={};for(;;){const r=t.readFieldBegin(),n=r.ftype,o=r.fid;if(n===i.Thrift.Type.STOP)break;switch(o){case 1:if(n===i.Thrift.Type.I32){const r=t.readI32();e.num_values=r}else t.skip(n);break;case 2:if(n===i.Thrift.Type.I32){const r=t.readI32();e.encoding=r}else t.skip(n);break;case 3:if(n===i.Thrift.Type.BOOL){const r=t.readBool();e.is_sorted=r}else t.skip(n);break;default:t.skip(n)}t.readFieldEnd()}if(t.readStructEnd(),void 0!==e.num_values&&void 0!==e.encoding)return new a(e);throw new i.Thrift.TProtocolException(i.Thrift.TProtocolExceptionType.UNKNOWN,"Unable to read DictionaryPageHeader from input")}}class u{constructor(){}write(t){t.writeStructBegin("IndexPageHeader"),t.writeFieldStop(),t.writeStructEnd()}static read(t){for(t.readStructBegin();;){const e=t.readFieldBegin(),r=e.ftype;e.fid;if(r===i.Thrift.Type.STOP)break;t.skip(r),t.readFieldEnd()}return t.readStructEnd(),new u}}function f(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}class l{constructor(t){if(f(this,"type",void 0),f(this,"uncompressed_page_size",void 0),f(this,"compressed_page_size",void 0),f(this,"crc",void 0),f(this,"data_page_header",void 0),f(this,"index_page_header",void 0),f(this,"dictionary_page_header",void 0),f(this,"data_page_header_v2",void 0),null==t||null==t.type)throw new i.Thrift.TProtocolException(i.Thrift.TProtocolExceptionType.UNKNOWN,"Required field[type] is unset!");if(this.type=t.type,null==t||null==t.uncompressed_page_size)throw new i.Thrift.TProtocolException(i.Thrift.TProtocolExceptionType.UNKNOWN,"Required field[uncompressed_page_size] is unset!");if(this.uncompressed_page_size=t.uncompressed_page_size,null==t||null==t.compressed_page_size)throw new i.Thrift.TProtocolException(i.Thrift.TProtocolExceptionType.UNKNOWN,"Required field[compressed_page_size] is unset!");this.compressed_page_size=t.compressed_page_size,null!=t&&null!=t.crc&&(this.crc=t.crc),null!=t&&null!=t.data_page_header&&(this.data_page_header=t.data_page_header),null!=t&&null!=t.index_page_header&&(this.index_page_header=t.index_page_header),null!=t&&null!=t.dictionary_page_header&&(this.dictionary_page_header=t.dictionary_page_header),null!=t&&null!=t.data_page_header_v2&&(this.data_page_header_v2=t.data_page_header_v2)}write(t){t.writeStructBegin("PageHeader"),null!=this.type&&(t.writeFieldBegin("type",i.Thrift.Type.I32,1),t.writeI32(this.type),t.writeFieldEnd()),null!=this.uncompressed_page_size&&(t.writeFieldBegin("uncompressed_page_size",i.Thrift.Type.I32,2),t.writeI32(this.uncompressed_page_size),t.writeFieldEnd()),null!=this.compressed_page_size&&(t.writeFieldBegin("compressed_page_size",i.Thrift.Type.I32,3),t.writeI32(this.compressed_page_size),t.writeFieldEnd()),null!=this.crc&&(t.writeFieldBegin("crc",i.Thrift.Type.I32,4),t.writeI32(this.crc),t.writeFieldEnd()),null!=this.data_page_header&&(t.writeFieldBegin("data_page_header",i.Thrift.Type.STRUCT,5),this.data_page_header.write(t),t.writeFieldEnd()),null!=this.index_page_header&&(t.writeFieldBegin("index_page_header",i.Thrift.Type.STRUCT,6),this.index_page_header.write(t),t.writeFieldEnd()),null!=this.dictionary_page_header&&(t.writeFieldBegin("dictionary_page_header",i.Thrift.Type.STRUCT,7),this.dictionary_page_header.write(t),t.writeFieldEnd()),null!=this.data_page_header_v2&&(t.writeFieldBegin("data_page_header_v2",i.Thrift.Type.STRUCT,8),this.data_page_header_v2.write(t),t.writeFieldEnd()),t.writeFieldStop(),t.writeStructEnd()}static read(t){t.readStructBegin();let e={};for(;;){const r=t.readFieldBegin(),s=r.ftype,f=r.fid;if(s===i.Thrift.Type.STOP)break;switch(f){case 1:if(s===i.Thrift.Type.I32){const r=t.readI32();e.type=r}else t.skip(s);break;case 2:if(s===i.Thrift.Type.I32){const r=t.readI32();e.uncompressed_page_size=r}else t.skip(s);break;case 3:if(s===i.Thrift.Type.I32){const r=t.readI32();e.compressed_page_size=r}else t.skip(s);break;case 4:if(s===i.Thrift.Type.I32){const r=t.readI32();e.crc=r}else t.skip(s);break;case 5:if(s===i.Thrift.Type.STRUCT){const r=n.a.read(t);e.data_page_header=r}else t.skip(s);break;case 6:if(s===i.Thrift.Type.STRUCT){const r=u.read(t);e.index_page_header=r}else t.skip(s);break;case 7:if(s===i.Thrift.Type.STRUCT){const r=a.read(t);e.dictionary_page_header=r}else t.skip(s);break;case 8:if(s===i.Thrift.Type.STRUCT){const r=o.a.read(t);e.data_page_header_v2=r}else t.skip(s);break;default:t.skip(s)}t.readFieldEnd()}if(t.readStructEnd(),void 0!==e.type&&void 0!==e.uncompressed_page_size&&void 0!==e.compressed_page_size)return new l(e);throw new i.Thrift.TProtocolException(i.Thrift.TProtocolExceptionType.UNKNOWN,"Unable to read PageHeader from input")}}}])}));
|
|
50
|
+
!function(e){"use strict";"function"==typeof bootstrap?bootstrap("promise",e):t.exports=e()}((function(){"use strict";var t=!1;try{throw new Error}catch(e){t=!!e.stack}var i,n=E(),o=function(){},s=function(){var t={task:void 0,next:null},i=t,n=!1,o=void 0,a=!1,u=[];function f(){for(var e,r;t.next;)e=(t=t.next).task,t.task=void 0,(r=t.domain)&&(t.domain=void 0,r.enter()),l(e,r);for(;u.length;)l(e=u.pop());n=!1}function l(t,e){try{t()}catch(t){if(a)throw e&&e.exit(),setTimeout(f,0),e&&e.enter(),t;setTimeout((function(){throw t}),0)}e&&e.exit()}if(s=function(t){i=i.next={task:t,domain:a&&e.domain,next:null},n||(n=!0,o())},"object"==typeof e&&"[object process]"===e.toString()&&e.nextTick)a=!0,o=function(){e.nextTick(f)};else if("function"==typeof r)o="undefined"!=typeof window?r.bind(window,f):function(){r(f)};else if("undefined"!=typeof MessageChannel){var c=new MessageChannel;c.port1.onmessage=function(){o=h,c.port1.onmessage=f,f()};var h=function(){c.port2.postMessage(0)};o=function(){setTimeout(f,0),h()}}else o=function(){setTimeout(f,0)};return s.runAfter=function(t){u.push(t),n||(n=!0,o())},s}(),a=Function.call;function u(t){return function(){return a.apply(t,arguments)}}var f,l=u(Array.prototype.slice),c=u(Array.prototype.reduce||function(t,e){var r=0,i=this.length;if(1===arguments.length)for(;;){if(r in this){e=this[r++];break}if(++r>=i)throw new TypeError}for(;r<i;r++)r in this&&(e=t(e,this[r],r));return e}),h=u(Array.prototype.indexOf||function(t){for(var e=0;e<this.length;e++)if(this[e]===t)return e;return-1}),d=u(Array.prototype.map||function(t,e){var r=this,i=[];return c(r,(function(n,o,s){i.push(t.call(e,o,s,r))}),void 0),i}),p=Object.create||function(t){function e(){}return e.prototype=t,new e},_=Object.defineProperty||function(t,e,r){return t[e]=r.value,t},y=u(Object.prototype.hasOwnProperty),w=Object.keys||function(t){var e=[];for(var r in t)y(t,r)&&e.push(r);return e},g=u(Object.prototype.toString);function T(t){return"[object StopIteration]"===g(t)||t instanceof f}f="undefined"!=typeof ReturnValue?ReturnValue:function(t){this.value=t};function v(e,r){if(t&&r.stack&&"object"==typeof e&&null!==e&&e.stack){for(var i=[],n=r;n;n=n.source)n.stack&&(!e.__minimumStackCounter__||e.__minimumStackCounter__>n.stackCounter)&&(_(e,"__minimumStackCounter__",{value:n.stackCounter,configurable:!0}),i.unshift(n.stack));i.unshift(e.stack);var o=function(t){for(var e=t.split("\n"),r=[],i=0;i<e.length;++i){var n=e[i];!b(n)&&(-1===(o=n).indexOf("(module.js:")&&-1===o.indexOf("(node.js:"))&&n&&r.push(n)}var o;return r.join("\n")}(i.join("\nFrom previous event:\n"));_(e,"stack",{value:o,configurable:!0})}}function m(t){var e=/at .+ \((.+):(\d+):(?:\d+)\)$/.exec(t);if(e)return[e[1],Number(e[2])];var r=/at ([^ ]+):(\d+):(?:\d+)$/.exec(t);if(r)return[r[1],Number(r[2])];var i=/.*@(.+):(\d+)$/.exec(t);return i?[i[1],Number(i[2])]:void 0}function b(t){var e=m(t);if(!e)return!1;var r=e[0],o=e[1];return r===i&&o>=n&&o<=H}function E(){if(t)try{throw new Error}catch(t){var e=t.stack.split("\n"),r=m(e[0].indexOf("@")>0?e[1]:e[2]);if(!r)return;return i=r[0],r[1]}}function S(t){return t instanceof k?t:L(t)?function(t){var e=N();return S.nextTick((function(){try{t.then(e.resolve,e.reject,e.notify)}catch(t){e.reject(t)}})),e.promise}(t):q(t)}S.resolve=S,S.nextTick=s,S.longStackSupport=!1;var B=1;function N(){var e,r=[],i=[],n=p(N.prototype),o=p(k.prototype);if(o.promiseDispatch=function(t,n,o){var s=l(arguments);r?(r.push(s),"when"===n&&o[1]&&i.push(o[1])):S.nextTick((function(){e.promiseDispatch.apply(e,s)}))},o.valueOf=function(){if(r)return o;var t=R(e);return x(t)&&(e=t),t},o.inspect=function(){return e?e.inspect():{state:"pending"}},S.longStackSupport&&t)try{throw new Error}catch(t){o.stack=t.stack.substring(t.stack.indexOf("\n")+1),o.stackCounter=B++}function s(n){e=n,S.longStackSupport&&t&&(o.source=n),c(r,(function(t,e){S.nextTick((function(){n.promiseDispatch.apply(n,e)}))}),void 0),r=void 0,i=void 0}return n.promise=o,n.resolve=function(t){e||s(S(t))},n.fulfill=function(t){e||s(q(t))},n.reject=function(t){e||s(W(t))},n.notify=function(t){e||c(i,(function(e,r){S.nextTick((function(){r(t)}))}),void 0)},n}function I(t){if("function"!=typeof t)throw new TypeError("resolver must be a function.");var e=N();try{t(e.resolve,e.reject,e.notify)}catch(t){e.reject(t)}return e.promise}function O(t){return I((function(e,r){for(var i=0,n=t.length;i<n;i++)S(t[i]).then(e,r)}))}function k(t,e,r){void 0===e&&(e=function(t){return W(new Error("Promise does not support operation: "+t))}),void 0===r&&(r=function(){return{state:"unknown"}});var i=p(k.prototype);if(i.promiseDispatch=function(r,n,o){var s;try{s=t[n]?t[n].apply(i,o):e.call(i,n,o)}catch(t){s=W(t)}r&&r(s)},i.inspect=r,r){var n=r();"rejected"===n.state&&(i.exception=n.reason),i.valueOf=function(){var t=r();return"pending"===t.state||"rejected"===t.state?i:t.value}}return i}function A(t,e,r,i){return S(t).then(e,r,i)}function R(t){if(x(t)){var e=t.inspect();if("fulfilled"===e.state)return e.value}return t}function x(t){return t instanceof k}function L(t){return(e=t)===Object(e)&&"function"==typeof t.then;var e}"object"==typeof e&&e&&e.env&&e.env.Q_DEBUG&&(S.longStackSupport=!0),S.defer=N,N.prototype.makeNodeResolver=function(){var t=this;return function(e,r){e?t.reject(e):arguments.length>2?t.resolve(l(arguments,1)):t.resolve(r)}},S.Promise=I,S.promise=I,I.race=O,I.all=V,I.reject=W,I.resolve=S,S.passByCopy=function(t){return t},k.prototype.passByCopy=function(){return this},S.join=function(t,e){return S(t).join(e)},k.prototype.join=function(t){return S([this,t]).spread((function(t,e){if(t===e)return t;throw new Error("Q can't join: not the same: "+t+" "+e)}))},S.race=O,k.prototype.race=function(){return this.then(S.race)},S.makePromise=k,k.prototype.toString=function(){return"[object Promise]"},k.prototype.then=function(t,e,r){var i=this,n=N(),o=!1;return S.nextTick((function(){i.promiseDispatch((function(e){o||(o=!0,n.resolve(function(e){try{return"function"==typeof t?t(e):e}catch(t){return W(t)}}(e)))}),"when",[function(t){o||(o=!0,n.resolve(function(t){if("function"==typeof e){v(t,i);try{return e(t)}catch(t){return W(t)}}return W(t)}(t)))}])})),i.promiseDispatch(void 0,"when",[void 0,function(t){var e,i=!1;try{e=function(t){return"function"==typeof r?r(t):t}(t)}catch(t){if(i=!0,!S.onerror)throw t;S.onerror(t)}i||n.notify(e)}]),n.promise},S.tap=function(t,e){return S(t).tap(e)},k.prototype.tap=function(t){return t=S(t),this.then((function(e){return t.fcall(e).thenResolve(e)}))},S.when=A,k.prototype.thenResolve=function(t){return this.then((function(){return t}))},S.thenResolve=function(t,e){return S(t).thenResolve(e)},k.prototype.thenReject=function(t){return this.then((function(){throw t}))},S.thenReject=function(t,e){return S(t).thenReject(e)},S.nearer=R,S.isPromise=x,S.isPromiseAlike=L,S.isPending=function(t){return x(t)&&"pending"===t.inspect().state},k.prototype.isPending=function(){return"pending"===this.inspect().state},S.isFulfilled=function(t){return!x(t)||"fulfilled"===t.inspect().state},k.prototype.isFulfilled=function(){return"fulfilled"===this.inspect().state},S.isRejected=function(t){return x(t)&&"rejected"===t.inspect().state},k.prototype.isRejected=function(){return"rejected"===this.inspect().state};var P,M,U,D=[],F=[],C=[],j=!0;function z(){D.length=0,F.length=0,j||(j=!0)}function W(t){var r=k({when:function(r){return r&&function(t){if(j){var r=h(F,t);-1!==r&&("object"==typeof e&&"function"==typeof e.emit&&S.nextTick.runAfter((function(){var i=h(C,t);-1!==i&&(e.emit("rejectionHandled",D[r],t),C.splice(i,1))})),F.splice(r,1),D.splice(r,1))}}(this),r?r(t):this}},(function(){return this}),(function(){return{state:"rejected",reason:t}}));return function(t,r){j&&("object"==typeof e&&"function"==typeof e.emit&&S.nextTick.runAfter((function(){-1!==h(F,t)&&(e.emit("unhandledRejection",r,t),C.push(t))})),F.push(t),r&&void 0!==r.stack?D.push(r.stack):D.push("(no stack) "+r))}(r,t),r}function q(t){return k({when:function(){return t},get:function(e){return t[e]},set:function(e,r){t[e]=r},delete:function(e){delete t[e]},post:function(e,r){return null==e?t.apply(void 0,r):t[e].apply(t,r)},apply:function(e,r){return t.apply(e,r)},keys:function(){return w(t)}},void 0,(function(){return{state:"fulfilled",value:t}}))}function Y(t,e,r){return S(t).spread(e,r)}function Z(t,e,r){return S(t).dispatch(e,r)}function V(t){return A(t,(function(t){var e=0,r=N();return c(t,(function(i,n,o){var s;x(n)&&"fulfilled"===(s=n.inspect()).state?t[o]=s.value:(++e,A(n,(function(i){t[o]=i,0==--e&&r.resolve(t)}),r.reject,(function(t){r.notify({index:o,value:t})})))}),void 0),0===e&&r.resolve(t),r.promise}))}function G(t){if(0===t.length)return S.resolve();var e=S.defer(),r=0;return c(t,(function(i,n,o){var s=t[o];r++,A(s,(function(t){e.resolve(t)}),(function(t){if(0===--r){var i=t||new Error(""+t);i.message="Q can't get fulfillment value from any promise, all promises were rejected. Last error message: "+i.message,e.reject(i)}}),(function(t){e.notify({index:o,value:t})}))}),void 0),e.promise}function K(t){return A(t,(function(t){return t=d(t,S),A(V(d(t,(function(t){return A(t,o,o)}))),(function(){return t}))}))}S.resetUnhandledRejections=z,S.getUnhandledReasons=function(){return D.slice()},S.stopUnhandledRejectionTracking=function(){z(),j=!1},z(),S.reject=W,S.fulfill=q,S.master=function(t){return k({isDef:function(){}},(function(e,r){return Z(t,e,r)}),(function(){return S(t).inspect()}))},S.spread=Y,k.prototype.spread=function(t,e){return this.all().then((function(e){return t.apply(void 0,e)}),e)},S.async=function(t){return function(){function e(t,e){var o;if("undefined"==typeof StopIteration){try{o=r[t](e)}catch(t){return W(t)}return o.done?S(o.value):A(o.value,i,n)}try{o=r[t](e)}catch(t){return T(t)?S(t.value):W(t)}return A(o,i,n)}var r=t.apply(this,arguments),i=e.bind(e,"next"),n=e.bind(e,"throw");return i()}},S.spawn=function(t){S.done(S.async(t)())},S.return=function(t){throw new f(t)},S.promised=function(t){return function(){return Y([this,V(arguments)],(function(e,r){return t.apply(e,r)}))}},S.dispatch=Z,k.prototype.dispatch=function(t,e){var r=this,i=N();return S.nextTick((function(){r.promiseDispatch(i.resolve,t,e)})),i.promise},S.get=function(t,e){return S(t).dispatch("get",[e])},k.prototype.get=function(t){return this.dispatch("get",[t])},S.set=function(t,e,r){return S(t).dispatch("set",[e,r])},k.prototype.set=function(t,e){return this.dispatch("set",[t,e])},S.del=S.delete=function(t,e){return S(t).dispatch("delete",[e])},k.prototype.del=k.prototype.delete=function(t){return this.dispatch("delete",[t])},S.mapply=S.post=function(t,e,r){return S(t).dispatch("post",[e,r])},k.prototype.mapply=k.prototype.post=function(t,e){return this.dispatch("post",[t,e])},S.send=S.mcall=S.invoke=function(t,e){return S(t).dispatch("post",[e,l(arguments,2)])},k.prototype.send=k.prototype.mcall=k.prototype.invoke=function(t){return this.dispatch("post",[t,l(arguments,1)])},S.fapply=function(t,e){return S(t).dispatch("apply",[void 0,e])},k.prototype.fapply=function(t){return this.dispatch("apply",[void 0,t])},S.try=S.fcall=function(t){return S(t).dispatch("apply",[void 0,l(arguments,1)])},k.prototype.fcall=function(){return this.dispatch("apply",[void 0,l(arguments)])},S.fbind=function(t){var e=S(t),r=l(arguments,1);return function(){return e.dispatch("apply",[this,r.concat(l(arguments))])}},k.prototype.fbind=function(){var t=this,e=l(arguments);return function(){return t.dispatch("apply",[this,e.concat(l(arguments))])}},S.keys=function(t){return S(t).dispatch("keys",[])},k.prototype.keys=function(){return this.dispatch("keys",[])},S.all=V,k.prototype.all=function(){return V(this)},S.any=G,k.prototype.any=function(){return G(this)},S.allResolved=(P=K,M="allResolved",U="allSettled",function(){return"undefined"!=typeof console&&"function"==typeof console.warn&&console.warn(M+" is deprecated, use "+U+" instead.",new Error("").stack),P.apply(P,arguments)}),k.prototype.allResolved=function(){return K(this)},S.allSettled=function(t){return S(t).allSettled()},k.prototype.allSettled=function(){return this.then((function(t){return V(d(t,(function(t){function e(){return t.inspect()}return(t=S(t)).then(e,e)})))}))},S.fail=S.catch=function(t,e){return S(t).then(void 0,e)},k.prototype.fail=k.prototype.catch=function(t){return this.then(void 0,t)},S.progress=function(t,e){return S(t).then(void 0,void 0,e)},k.prototype.progress=function(t){return this.then(void 0,void 0,t)},S.fin=S.finally=function(t,e){return S(t).finally(e)},k.prototype.fin=k.prototype.finally=function(t){if(!t||"function"!=typeof t.apply)throw new Error("Q can't apply finally callback");return t=S(t),this.then((function(e){return t.fcall().then((function(){return e}))}),(function(e){return t.fcall().then((function(){throw e}))}))},S.done=function(t,e,r,i){return S(t).done(e,r,i)},k.prototype.done=function(t,r,i){var n=function(t){S.nextTick((function(){if(v(t,o),!S.onerror)throw t;S.onerror(t)}))},o=t||r||i?this.then(t,r,i):this;"object"==typeof e&&e&&e.domain&&(n=e.domain.bind(n)),o.then(void 0,n)},S.timeout=function(t,e,r){return S(t).timeout(e,r)},k.prototype.timeout=function(t,e){var r=N(),i=setTimeout((function(){e&&"string"!=typeof e||((e=new Error(e||"Timed out after "+t+" ms")).code="ETIMEDOUT"),r.reject(e)}),t);return this.then((function(t){clearTimeout(i),r.resolve(t)}),(function(t){clearTimeout(i),r.reject(t)}),r.notify),r.promise},S.delay=function(t,e){return void 0===e&&(e=t,t=void 0),S(t).delay(e)},k.prototype.delay=function(t){return this.then((function(e){var r=N();return setTimeout((function(){r.resolve(e)}),t),r.promise}))},S.nfapply=function(t,e){return S(t).nfapply(e)},k.prototype.nfapply=function(t){var e=N(),r=l(t);return r.push(e.makeNodeResolver()),this.fapply(r).fail(e.reject),e.promise},S.nfcall=function(t){var e=l(arguments,1);return S(t).nfapply(e)},k.prototype.nfcall=function(){var t=l(arguments),e=N();return t.push(e.makeNodeResolver()),this.fapply(t).fail(e.reject),e.promise},S.nfbind=S.denodeify=function(t){if(void 0===t)throw new Error("Q can't wrap an undefined function");var e=l(arguments,1);return function(){var r=e.concat(l(arguments)),i=N();return r.push(i.makeNodeResolver()),S(t).fapply(r).fail(i.reject),i.promise}},k.prototype.nfbind=k.prototype.denodeify=function(){var t=l(arguments);return t.unshift(this),S.denodeify.apply(void 0,t)},S.nbind=function(t,e){var r=l(arguments,2);return function(){var i=r.concat(l(arguments)),n=N();function o(){return t.apply(e,arguments)}return i.push(n.makeNodeResolver()),S(o).fapply(i).fail(n.reject),n.promise}},k.prototype.nbind=function(){var t=l(arguments,0);return t.unshift(this),S.nbind.apply(void 0,t)},S.nmapply=S.npost=function(t,e,r){return S(t).npost(e,r)},k.prototype.nmapply=k.prototype.npost=function(t,e){var r=l(e||[]),i=N();return r.push(i.makeNodeResolver()),this.dispatch("post",[t,r]).fail(i.reject),i.promise},S.nsend=S.nmcall=S.ninvoke=function(t,e){var r=l(arguments,2),i=N();return r.push(i.makeNodeResolver()),S(t).dispatch("post",[e,r]).fail(i.reject),i.promise},k.prototype.nsend=k.prototype.nmcall=k.prototype.ninvoke=function(t){var e=l(arguments,1),r=N();return e.push(r.makeNodeResolver()),this.dispatch("post",[t,e]).fail(r.reject),r.promise},S.nodeify=function(t,e){return S(t).nodeify(e)},k.prototype.nodeify=function(t){if(!t)return this;this.then((function(e){S.nextTick((function(){t(null,e)}))}),(function(e){S.nextTick((function(){t(e)}))}))},S.noConflict=function(){throw new Error("Q.noConflict only works when Q is used as a global")};var H=E();return S}))}).call(this,r(5),r(51).setImmediate)},function(t,e,r){var i=r(4),n=r(8);function o(t,e,r){function o(t,r,i){e.call(this,t,r,i)}return i.inherits(o,e),o.prototype.writeMessageBegin=function(e,i,s){i==n.MessageType.CALL||i==n.MessageType.ONEWAY?(r.seqId2Service[s]=t,o.super_.prototype.writeMessageBegin.call(this,t+":"+e,i,s)):o.super_.prototype.writeMessageBegin.call(this,e,i,s)},o}function s(){this.seqid=0}e.Multiplexer=s,s.prototype.createClient=function(t,e,r){e.Client&&(e=e.Client);var i=new e(new r.transport(void 0,(function(t,e){r.write(t,e)})),new o(t,r.protocol,r)),n=this;return i.new_seqid=function(){return n.seqid+=1,n.seqid},"object"!=typeof r.client&&(r.client={}),r.client[t]=i,i}},function(t,e,r){var i=r(38),n=r(10),o=r(57);function s(t,e){this.inBuf=t||new Buffer(0),this.outBuffers=[],this.outCount=0,this.readPos=0,this.onFlush=e}t.exports=s,s.prototype=new o,s.receiver=function(t,e){var r=null;return function(n){for(r&&(n=Buffer.concat([r,n]),r=null);n.length;){if(n.length<4)return void(r=n);var o=i.readI32(n,0);if(n.length<4+o)return void(r=n);var a=n.slice(4,4+o);r=n.slice(4+o),t(new s(a),e),n=r,r=null}}},s.prototype.commitPosition=function(){},s.prototype.rollbackPosition=function(){},s.prototype.isOpen=function(){return!0},s.prototype.open=function(){},s.prototype.close=function(){},s.prototype.setCurrSeqId=function(t){this._seqid=t},s.prototype.ensureAvailable=function(t){if(this.readPos+t>this.inBuf.length)throw new n},s.prototype.read=function(t){this.ensureAvailable(t);var e=this.readPos+t;if(this.inBuf.length<e)throw new Error("read("+t+") failed - not enough data");var r=this.inBuf.slice(this.readPos,e);return this.readPos=e,r},s.prototype.readByte=function(){return this.ensureAvailable(1),i.readByte(this.inBuf[this.readPos++])},s.prototype.readI16=function(){this.ensureAvailable(2);var t=i.readI16(this.inBuf,this.readPos);return this.readPos+=2,t},s.prototype.readI32=function(){this.ensureAvailable(4);var t=i.readI32(this.inBuf,this.readPos);return this.readPos+=4,t},s.prototype.readDouble=function(){this.ensureAvailable(8);var t=i.readDouble(this.inBuf,this.readPos);return this.readPos+=8,t},s.prototype.readString=function(t){this.ensureAvailable(t);var e=this.inBuf.toString("utf8",this.readPos,this.readPos+t);return this.readPos+=t,e},s.prototype.borrow=function(){return{buf:this.inBuf,readIndex:this.readPos,writeIndex:this.inBuf.length}},s.prototype.consume=function(t){this.readPos+=t},s.prototype.write=function(t,e){"string"==typeof t&&(t=new Buffer(t,e||"utf8")),this.outBuffers.push(t),this.outCount+=t.length},s.prototype.flush=function(){var t=this._seqid;this._seqid=null;var e=new Buffer(this.outCount),r=0;if(this.outBuffers.forEach((function(t){t.copy(e,r,0),r+=t.length})),this.onFlush){var n=new Buffer(e.length+4);i.writeI32(n,e.length),e.copy(n,4,0,e.length),this.onFlush&&this.onFlush(n,t)}this.outBuffers=[],this.outCount=0}},function(t,e,r){var i=r(39);function n(t){this.__reset(t)}t.exports=n,n.prototype.__reset=function(t){this.url=t,this.socket=null,this.callbacks=[],this.send_pending=[],this.send_buf="",this.recv_buf="",this.rb_wpos=0,this.rb_rpos=0},n.prototype.flush=function(t,e){var r,i=this;this.isOpen()?(this.socket.send(this.send_buf),this.callbacks.push((r=e,function(t){i.setRecvBuffer(t),r()}))):this.send_pending.push({buf:this.send_buf,cb:e})},n.prototype.__onOpen=function(){var t=this;this.send_pending.length>0&&(this.send_pending.forEach((function(e){var r;t.socket.send(e.buf),t.callbacks.push((r=e.cb,function(e){t.setRecvBuffer(e),r()}))})),this.send_pending=[])},n.prototype.__onClose=function(t){this.__reset(this.url)},n.prototype.__onMessage=function(t){this.callbacks.length&&this.callbacks.shift()(t.data)},n.prototype.__onError=function(t){i.error("websocket: "+t.toString()),this.socket.close()},n.prototype.setRecvBuffer=function(t){this.recv_buf=t,this.recv_buf_sz=this.recv_buf.length,this.wpos=this.recv_buf.length,this.rpos=0},n.prototype.isOpen=function(){return this.socket&&this.socket.readyState==this.socket.OPEN},n.prototype.open=function(){this.socket&&this.socket.readyState!=this.socket.CLOSED||(this.socket=new WebSocket(this.url),this.socket.onopen=this.__onOpen.bind(this),this.socket.onmessage=this.__onMessage.bind(this),this.socket.onerror=this.__onError.bind(this),this.socket.onclose=this.__onClose.bind(this))},n.prototype.close=function(){this.socket.close()},n.prototype.read=function(t){var e=this.wpos-this.rpos;if(0===e)return"";var r=t;e<t&&(r=e);var i=this.read_buf.substr(this.rpos,r);return this.rpos+=r,i},n.prototype.readAll=function(){return this.recv_buf},n.prototype.write=function(t){this.send_buf=t},n.prototype.getSendBuffer=function(){return this.send_buf}},function(t,e,r){"use strict";r.r(e),r.d(e,"ParquetReader",(function(){return K})),r.d(e,"ParquetEnvelopeReader",(function(){return H})),r.d(e,"ParquetWriter",(function(){return ht})),r.d(e,"ParquetEnvelopeWriter",(function(){return dt})),r.d(e,"ParquetTransformer",(function(){return pt})),r.d(e,"ParquetSchema",(function(){return U})),r.d(e,"ParquetLoader",(function(){return gt})),r.d(e,"ParquetWorkerLoader",(function(){return wt})),r.d(e,"_ParquetWriter",(function(){return Tt}));var i=r(12),n=r.n(i);var o=r(18),s=r.n(o);function a(t,e,r){const i=r.bitWidth;if(e%8!=0)throw new Error("must be a multiple of 8");const n=new Array(e).fill(0);for(let r=0;r<i*e;r++)t.buffer[t.offset+Math.floor(r/8)]&1<<r%8&&(n[Math.floor(r/i)]|=1<<r%i);return t.offset+=i*(e/8),n}function u(t,e,r){const i=r.bitWidth;let n=0;for(let e=0;e<Math.ceil(i/8);e++)n<<=8,n+=t.buffer[t.offset],t.offset+=1;return new Array(e).fill(n)}function f(t,e){const r=e.bitWidth;for(let e=0;e<t.length%8;e++)t.push(0);const i=Buffer.alloc(Math.ceil(r*(t.length/8)));for(let e=0;e<r*t.length;e++)(t[Math.floor(e/r)]&1<<e%r)>0&&(i[Math.floor(e/8)]|=1<<e%8);return Buffer.concat([Buffer.from(s.a.encode(t.length/8<<1|1)),i])}function l(t,e,r){const i=r.bitWidth,n=Buffer.alloc(Math.ceil(i/8));for(let e=0;e<n.length;e++)n.writeUInt8(255&t,e),t>>=8;return Buffer.concat([Buffer.from(s.a.encode(e<<1)),n])}const c={PLAIN:{encodeValues:function(t,e,r){switch(t){case"BOOLEAN":return function(t){const e=Buffer.alloc(Math.ceil(t.length/8));e.fill(0);for(let r=0;r<t.length;r++)t[r]&&(e[Math.floor(r/8)]|=1<<r%8);return e}(e);case"INT32":return function(t){const e=Buffer.alloc(4*t.length);for(let r=0;r<t.length;r++)e.writeInt32LE(t[r],4*r);return e}(e);case"INT64":return function(t){const e=Buffer.alloc(8*t.length);for(let r=0;r<t.length;r++)n.a.writeInt64LE(t[r],e,8*r);return e}(e);case"INT96":return function(t){const e=Buffer.alloc(12*t.length);for(let r=0;r<t.length;r++)t[r]>=0?(n.a.writeInt64LE(t[r],e,12*r),e.writeUInt32LE(0,12*r+8)):(n.a.writeInt64LE(1+~-t[r],e,12*r),e.writeUInt32LE(4294967295,12*r+8));return e}(e);case"FLOAT":return function(t){const e=Buffer.alloc(4*t.length);for(let r=0;r<t.length;r++)e.writeFloatLE(t[r],4*r);return e}(e);case"DOUBLE":return function(t){const e=Buffer.alloc(8*t.length);for(let r=0;r<t.length;r++)e.writeDoubleLE(t[r],8*r);return e}(e);case"BYTE_ARRAY":return function(t){let e=0;for(let r=0;r<t.length;r++)t[r]=Buffer.from(t[r]),e+=4+t[r].length;const r=Buffer.alloc(e);let i=0;for(let e=0;e<t.length;e++)r.writeUInt32LE(t[e].length,i),t[e].copy(r,i+4),i+=4+t[e].length;return r}(e);case"FIXED_LEN_BYTE_ARRAY":return function(t,e){if(!e.typeLength)throw new Error("missing option: typeLength (required for FIXED_LEN_BYTE_ARRAY)");for(let r=0;r<t.length;r++)if(t[r]=Buffer.from(t[r]),t[r].length!==e.typeLength)throw new Error("invalid value for FIXED_LEN_BYTE_ARRAY: "+t[r]);return Buffer.concat(t)}(e,r);default:throw new Error("unsupported type: "+t)}},decodeValues:function(t,e,r,i){switch(t){case"BOOLEAN":return function(t,e){const r=[];for(let i=0;i<e;i++){const e=t.buffer[t.offset+Math.floor(i/8)];r.push((e&1<<i%8)>0)}return t.offset+=Math.ceil(e/8),r}(e,r);case"INT32":return function(t,e){const r=[];for(let i=0;i<e;i++)r.push(t.buffer.readInt32LE(t.offset)),t.offset+=4;return r}(e,r);case"INT64":return function(t,e){const r=[];for(let i=0;i<e;i++)r.push(n.a.readInt64LE(t.buffer,t.offset)),t.offset+=8;return r}(e,r);case"INT96":return function(t,e){const r=[];for(let i=0;i<e;i++){const e=n.a.readInt64LE(t.buffer,t.offset);4294967295===t.buffer.readUInt32LE(t.offset+8)?r.push(1+~-e):r.push(e),t.offset+=12}return r}(e,r);case"FLOAT":return function(t,e){const r=[];for(let i=0;i<e;i++)r.push(t.buffer.readFloatLE(t.offset)),t.offset+=4;return r}(e,r);case"DOUBLE":return function(t,e){const r=[];for(let i=0;i<e;i++)r.push(t.buffer.readDoubleLE(t.offset)),t.offset+=8;return r}(e,r);case"BYTE_ARRAY":return function(t,e){const r=[];for(let i=0;i<e;i++){const e=t.buffer.readUInt32LE(t.offset);t.offset+=4,r.push(t.buffer.slice(t.offset,t.offset+e)),t.offset+=e}return r}(e,r);case"FIXED_LEN_BYTE_ARRAY":return function(t,e,r){const i=[];if(!r.typeLength)throw new Error("missing option: typeLength (required for FIXED_LEN_BYTE_ARRAY)");for(let n=0;n<e;n++)i.push(t.buffer.slice(t.offset,t.offset+r.typeLength)),t.offset+=r.typeLength;return i}(e,r,i);default:throw new Error("unsupported type: "+t)}}},RLE:{encodeValues:function(t,e,r){if(!("bitWidth"in r))throw new Error("bitWidth is required");switch(t){case"BOOLEAN":case"INT32":case"INT64":e=e.map(t=>parseInt(t,10));break;default:throw new Error("unsupported type: "+t)}let i=Buffer.alloc(0),n=[],o=0;for(let t=0;t<e.length;t++)0===o&&n.length%8==0&&e[t]===e[t+1]?(n.length&&(i=Buffer.concat([i,f(n,r)]),n=[]),o=1):o>0&&e[t]===e[t-1]?o+=1:(o&&(i=Buffer.concat([i,l(e[t-1],o,r)]),o=0),n.push(e[t]));if(o?i=Buffer.concat([i,l(e[e.length-1],o,r)]):n.length&&(i=Buffer.concat([i,f(n,r)])),r.disableEnvelope)return i;const s=Buffer.alloc(i.length+4);return s.writeUInt32LE(i.length,void 0),i.copy(s,4),s},decodeValues:function(t,e,r,i){if(!("bitWidth"in i))throw new Error("bitWidth is required");i.disableEnvelope||(e.offset+=4);let n=[];for(;n.length<r;){const t=s.a.decode(e.buffer,e.offset);if(e.offset+=s.a.encodingLength(t),1&t){const r=8*(t>>1);n.push(...a(e,r,i))}else{const r=t>>1;n.push(...u(e,r,i))}}if(n=n.slice(0,r),n.length!==r)throw new Error("invalid RLE encoding");return n}}};var h=r(1),d=r(42),p=r.n(d),_=r(43),y=r.n(_);let w,g,T;const v={UNCOMPRESSED:{deflate:function(t){return t},inflate:function(t){return t}},GZIP:{deflate:function(t){return p.a.gzipSync(t)},inflate:function(t){return p.a.gunzipSync(t)}},SNAPPY:{deflate:function(t){return y.a.compress(t)},inflate:function(t){return y.a.uncompress(t)}},LZO:{deflate:function(t){return g=g||h.j("lzo"),g.compress(t)},inflate:function(t,e){return g=g||h.j("lzo"),g.decompress(t,e)}},BROTLI:{deflate:function(t){w=w||h.j("brotli");const e=w.compress(t,{mode:0,quality:8,lgwin:22});return e?Buffer.from(e):Buffer.alloc(0)},inflate:function(t){if(w=w||h.j("brotli"),!t.length)return Buffer.alloc(0);return Buffer.from(w.decompress(t))}},LZ4:{deflate:function(t){T=T||h.j("lz4js");try{return Buffer.from(T.compress(t))}catch(t){throw t}},inflate:function(t,e){T=T||h.j("lz4js");try{return Buffer.from(T.decompress(t,e))}catch(t){throw t}}}};function m(t,e){if(!(t in v))throw new Error("invalid compression method: "+t);return v[t].deflate(e)}function b(t,e,r){if(!(t in v))throw new Error("invalid compression method: "+t);return v[t].inflate(e,r)}var E=r(41),S=r.n(E);const B={BOOLEAN:{primitiveType:"BOOLEAN",toPrimitive:function(t){return Boolean(t)},fromPrimitive:function(t){return Boolean(t)}},INT32:{primitiveType:"INT32",toPrimitive:O},INT64:{primitiveType:"INT64",toPrimitive:k},INT96:{primitiveType:"INT96",toPrimitive:function(t){const e=parseInt(t,10);if(isNaN(e))throw new Error("invalid value for INT96: "+t);return e}},FLOAT:{primitiveType:"FLOAT",toPrimitive:function(t){const e=parseFloat(t);if(isNaN(e))throw new Error("invalid value for FLOAT: "+t);return e}},DOUBLE:{primitiveType:"DOUBLE",toPrimitive:function(t){const e=parseFloat(t);if(isNaN(e))throw new Error("invalid value for DOUBLE: "+t);return e}},BYTE_ARRAY:{primitiveType:"BYTE_ARRAY",toPrimitive:A},FIXED_LEN_BYTE_ARRAY:{primitiveType:"FIXED_LEN_BYTE_ARRAY",toPrimitive:A},UTF8:{primitiveType:"BYTE_ARRAY",originalType:"UTF8",toPrimitive:function(t){return Buffer.from(t,"utf8")},fromPrimitive:function(t){return t.toString()}},TIME_MILLIS:{primitiveType:"INT32",originalType:"TIME_MILLIS",toPrimitive:function(t){const e=parseInt(t,10);if(e<0||e>0x10000000000000000||isNaN(e))throw new Error("invalid value for TIME_MILLIS: "+t);return e}},TIME_MICROS:{primitiveType:"INT64",originalType:"TIME_MICROS",toPrimitive:function(t){const e=parseInt(t,10);if(e<0||isNaN(e))throw new Error("invalid value for TIME_MICROS: "+t);return e}},DATE:{primitiveType:"INT32",originalType:"DATE",toPrimitive:function(t){if(t instanceof Date)return t.getTime()/864e5;{const e=parseInt(t,10);if(e<0||isNaN(e))throw new Error("invalid value for DATE: "+t);return e}},fromPrimitive:function(t){return new Date(864e5*t)}},TIMESTAMP_MILLIS:{primitiveType:"INT64",originalType:"TIMESTAMP_MILLIS",toPrimitive:function(t){if(t instanceof Date)return t.getTime();{const e=parseInt(t,10);if(e<0||isNaN(e))throw new Error("invalid value for TIMESTAMP_MILLIS: "+t);return e}},fromPrimitive:function(t){return new Date(t)}},TIMESTAMP_MICROS:{primitiveType:"INT64",originalType:"TIMESTAMP_MICROS",toPrimitive:function(t){if(t instanceof Date)return 1e3*t.getTime();{const e=parseInt(t,10);if(e<0||isNaN(e))throw new Error("invalid value for TIMESTAMP_MICROS: "+t);return e}},fromPrimitive:function(t){return new Date(t/1e3)}},UINT_8:{primitiveType:"INT32",originalType:"UINT_8",toPrimitive:function(t){const e=parseInt(t,10);if(e<0||e>255||isNaN(e))throw new Error("invalid value for UINT8: "+t);return e}},UINT_16:{primitiveType:"INT32",originalType:"UINT_16",toPrimitive:function(t){const e=parseInt(t,10);if(e<0||e>65535||isNaN(e))throw new Error("invalid value for UINT16: "+t);return e}},UINT_32:{primitiveType:"INT32",originalType:"UINT_32",toPrimitive:function(t){const e=parseInt(t,10);if(e<0||e>0xffffffffffff||isNaN(e))throw new Error("invalid value for UINT32: "+t);return e}},UINT_64:{primitiveType:"INT64",originalType:"UINT_64",toPrimitive:function(t){const e=parseInt(t,10);if(e<0||isNaN(e))throw new Error("invalid value for UINT64: "+t);return e}},INT_8:{primitiveType:"INT32",originalType:"INT_8",toPrimitive:function(t){const e=parseInt(t,10);if(e<-128||e>127||isNaN(e))throw new Error("invalid value for INT8: "+t);return e}},INT_16:{primitiveType:"INT32",originalType:"INT_16",toPrimitive:function(t){const e=parseInt(t,10);if(e<-32768||e>32767||isNaN(e))throw new Error("invalid value for INT16: "+t);return e}},INT_32:{primitiveType:"INT32",originalType:"INT_32",toPrimitive:O},INT_64:{primitiveType:"INT64",originalType:"INT_64",toPrimitive:k},JSON:{primitiveType:"BYTE_ARRAY",originalType:"JSON",toPrimitive:function(t){return Buffer.from(JSON.stringify(t))},fromPrimitive:function(t){return JSON.parse(t)}},BSON:{primitiveType:"BYTE_ARRAY",originalType:"BSON",toPrimitive:function(t){return Buffer.from(S.a.serialize(t))},fromPrimitive:function(t){return S.a.deserialize(t)}},INTERVAL:{primitiveType:"FIXED_LEN_BYTE_ARRAY",originalType:"INTERVAL",typeLength:12,toPrimitive:function(t){if(!t.months||!t.days||!t.milliseconds)throw new Error("value for INTERVAL must be object { months: ..., days: ..., milliseconds: ... }");const e=Buffer.alloc(12);return e.writeUInt32LE(t.months,0),e.writeUInt32LE(t.days,4),e.writeUInt32LE(t.milliseconds,8),e},fromPrimitive:function(t){const e=Buffer.from(t),r=e.readUInt32LE(0),i=e.readUInt32LE(4),n=e.readUInt32LE(8);return{months:r,days:i,milliseconds:n}}}};function N(t,e){if(!(t in B))throw new Error("invalid type: "+t);return B[t].toPrimitive(e)}function I(t,e){if(!(t in B))throw new Error("invalid type: "+t);var r,i;return"fromPrimitive"in B[t]?null===(r=(i=B[t]).fromPrimitive)||void 0===r?void 0:r.call(i,e):e}function O(t){const e=parseInt(t,10);if(e<-2147483648||e>2147483647||isNaN(e))throw new Error("invalid value for INT32: "+t);return e}function k(t){const e=parseInt(t,10);if(isNaN(e))throw new Error("invalid value for INT64: "+t);return e}function A(t){return Buffer.from(t)}function R(t){const e={};for(const r of t.fieldList)e[r.key]={dlevels:[],rlevels:[],values:[],count:0};return{rowCount:0,columnData:e}}function x(t,e,r){const i=R(t).columnData;if(function t(e,r,i,n,o){for(const s in e){const a=e[s];let u=[];if(r&&a.name in r&&void 0!==r[a.name]&&null!==r[a.name]&&(r[a.name].constructor===Array?u=r[a.name]:u.push(r[a.name])),0===u.length&&Boolean(r)&&"REQUIRED"===a.repetitionType)throw new Error("missing required field: "+a.name);if(u.length>1&&"REPEATED"!==a.repetitionType)throw new Error("too many values for field: "+a.name);if(0!==u.length)for(let e=0;e<u.length;e++){const r=0===e?n:a.rLevelMax;a.isNested?t(a.fields,u[e],i,r,a.dLevelMax):(i[a.key].count+=1,i[a.key].rlevels.push(r),i[a.key].dlevels.push(a.dLevelMax),i[a.key].values.push(N(a.originalType||a.primitiveType,u[e])))}else a.isNested?t(a.fields,null,i,n,o):(i[a.key].count+=1,i[a.key].rlevels.push(n),i[a.key].dlevels.push(o))}}(t.fields,e,i,0,0),0===r.rowCount)return r.rowCount=1,void(r.columnData=i);r.rowCount+=1;for(const e of t.fieldList)Array.prototype.push.apply(r.columnData[e.key].rlevels,i[e.key].rlevels),Array.prototype.push.apply(r.columnData[e.key].dlevels,i[e.key].dlevels),Array.prototype.push.apply(r.columnData[e.key].values,i[e.key].values),r.columnData[e.key].count+=i[e.key].count}function L(t,e){const r=[];for(let t=0;t<e.rowCount;t++)r.push({});for(const i in e.columnData)P(t,e,i,r);return r}function P(t,e,r,i){const n=e.columnData[r];if(!n.count)return;const o=t.findField(r),s=t.findFieldBranch(r),a=new Array(o.rLevelMax+1).fill(0);let u=0;for(let t=0;t<n.count;t++){const e=n.dlevels[t],r=n.rlevels[t];a[r]++,a.fill(0,r+1);let f=0,l=i[a[f++]-1];for(const t of s){if(t===o)break;if(e<t.dLevelMax)break;if("REPEATED"===t.repetitionType){t.name in l||(l[t.name]=[]);const e=a[f++];for(;l[t.name].length<=e;)l[t.name].push({});l=l[t.name][e]}else l[t.name]=l[t.name]||{},l=l[t.name]}if(e===o.dLevelMax){const t=I(o.originalType||o.primitiveType,n.values[u]);if(u++,"REPEATED"===o.repetitionType){o.name in l||(l[o.name]=[]);const e=a[f];for(;l[o.name].length<=e;)l[o.name].push(null);l[o.name][e]=t}else l[o.name]=t}}}function M(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}class U{constructor(t){M(this,"schema",void 0),M(this,"fields",void 0),M(this,"fieldList",void 0),this.schema=t,this.fields=function t(e,r,i,n){const o={};for(const s in e){const a=e[s],u=!a.optional,f=Boolean(a.repeated);let l=r,h=i,d="REQUIRED";if(u||(d="OPTIONAL",h++),f&&(d="REPEATED",l++,u&&h++),a.fields){const e=n.concat([s]);o[s]={name:s,path:e,key:e.join(),repetitionType:d,rLevelMax:l,dLevelMax:h,isNested:!0,fieldCount:Object.keys(a.fields).length,fields:t(a.fields,l,h,e)};continue}const p=B[a.type];if(!p)throw new Error("invalid parquet type: "+a.type);if(a.encoding=a.encoding||"PLAIN",!(a.encoding in c))throw new Error("unsupported parquet encoding: "+a.encoding);if(a.compression=a.compression||"UNCOMPRESSED",!(a.compression in v))throw new Error("unsupported compression method: "+a.compression);const _=n.concat([s]);o[s]={name:s,primitiveType:p.primitiveType,originalType:p.originalType,path:_,key:_.join(),repetitionType:d,encoding:a.encoding,compression:a.compression,typeLength:a.typeLength||p.typeLength,rLevelMax:l,dLevelMax:h}}return o}(t,0,0,[]),this.fieldList=function t(e){let r=[];for(const i in e)r.push(e[i]),e[i].isNested&&(r=r.concat(t(e[i].fields)));return r}(this.fields)}findField(t){t="string"==typeof t?t.split(","):t.slice(0);let e=this.fields;for(;t.length>1;t.shift())e=e[t[0]].fields;return e[t[0]]}findFieldBranch(t){"string"==typeof t&&(t=t.split(","));const e=[];let r=this.fields;for(;t.length>0;t.shift())e.push(r[t[0]]),t.length>1&&(r=r[t[0]].fields);return e}shredRecord(t,e){x(this,t,e)}materializeRecords(t){return L(this,t)}compress(t){return D(this.schema,t),D(this.fields,t),this}buffer(){return R(this)}}function D(t,e){for(const r in t){const i=t[r];i.fields?D(i.fields,e):i.compression=e}}let F,C,j,z,W,q,Y,Z;function V(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}!function(t){t[t.BOOLEAN=0]="BOOLEAN",t[t.INT32=1]="INT32",t[t.INT64=2]="INT64",t[t.INT96=3]="INT96",t[t.FLOAT=4]="FLOAT",t[t.DOUBLE=5]="DOUBLE",t[t.BYTE_ARRAY=6]="BYTE_ARRAY",t[t.FIXED_LEN_BYTE_ARRAY=7]="FIXED_LEN_BYTE_ARRAY"}(F||(F={})),function(t){t[t.UNCOMPRESSED=0]="UNCOMPRESSED",t[t.SNAPPY=1]="SNAPPY",t[t.GZIP=2]="GZIP",t[t.LZO=3]="LZO",t[t.BROTLI=4]="BROTLI",t[t.LZ4=5]="LZ4",t[t.ZSTD=6]="ZSTD"}(C||(C={})),function(t){t[t.DATA_PAGE=0]="DATA_PAGE",t[t.INDEX_PAGE=1]="INDEX_PAGE",t[t.DICTIONARY_PAGE=2]="DICTIONARY_PAGE",t[t.DATA_PAGE_V2=3]="DATA_PAGE_V2"}(j||(j={})),function(t){t[t.PLAIN=0]="PLAIN",t[t.PLAIN_DICTIONARY=2]="PLAIN_DICTIONARY",t[t.RLE=3]="RLE",t[t.BIT_PACKED=4]="BIT_PACKED",t[t.DELTA_BINARY_PACKED=5]="DELTA_BINARY_PACKED",t[t.DELTA_LENGTH_BYTE_ARRAY=6]="DELTA_LENGTH_BYTE_ARRAY",t[t.DELTA_BYTE_ARRAY=7]="DELTA_BYTE_ARRAY",t[t.RLE_DICTIONARY=8]="RLE_DICTIONARY"}(z||(z={})),function(t){t[t.REQUIRED=0]="REQUIRED",t[t.OPTIONAL=1]="OPTIONAL",t[t.REPEATED=2]="REPEATED"}(W||(W={})),function(t){t[t.UTF8=0]="UTF8",t[t.MAP=1]="MAP",t[t.MAP_KEY_VALUE=2]="MAP_KEY_VALUE",t[t.LIST=3]="LIST",t[t.ENUM=4]="ENUM",t[t.DECIMAL=5]="DECIMAL",t[t.DATE=6]="DATE",t[t.TIME_MILLIS=7]="TIME_MILLIS",t[t.TIME_MICROS=8]="TIME_MICROS",t[t.TIMESTAMP_MILLIS=9]="TIMESTAMP_MILLIS",t[t.TIMESTAMP_MICROS=10]="TIMESTAMP_MICROS",t[t.UINT_8=11]="UINT_8",t[t.UINT_16=12]="UINT_16",t[t.UINT_32=13]="UINT_32",t[t.UINT_64=14]="UINT_64",t[t.INT_8=15]="INT_8",t[t.INT_16=16]="INT_16",t[t.INT_32=17]="INT_32",t[t.INT_64=18]="INT_64",t[t.JSON=19]="JSON",t[t.BSON=20]="BSON",t[t.INTERVAL=21]="INTERVAL"}(q||(q={}));Y=Symbol.asyncIterator;class G{constructor(t,e,r,i){V(this,"metadata",void 0),V(this,"envelopeReader",void 0),V(this,"schema",void 0),V(this,"columnList",void 0),V(this,"rowGroup",void 0),V(this,"rowGroupIndex",void 0),this.metadata=t,this.envelopeReader=e,this.schema=r,this.columnList=i,this.rowGroup=[],this.rowGroupIndex=0}async next(){if(0===this.rowGroup.length){if(this.rowGroupIndex>=this.metadata.row_groups.length)return null;const t=await this.envelopeReader.readRowGroup(this.schema,this.metadata.row_groups[this.rowGroupIndex],this.columnList);this.rowGroup=L(this.schema,t),this.rowGroupIndex++}return this.rowGroup.shift()}rewind(){this.rowGroup=[],this.rowGroupIndex=0}[Y](){let t=!1;return{next:async()=>{if(t)return{done:t,value:null};const e=await this.next();return null===e?{done:!0,value:e}:{done:!1,value:e}},return:async()=>(t=!0,{done:t,value:null}),throw:async()=>(t=!0,{done:!0,value:null})}}}Z=Symbol.asyncIterator;class K{static async openFile(t){const e=await H.openFile(t);try{await e.readHeader();const t=await e.readFooter();return new K(t,e)}catch(t){throw await e.close(),t}}static async openBuffer(t){const e=await H.openBuffer(t);try{await e.readHeader();const t=await e.readFooter();return new K(t,e)}catch(t){throw await e.close(),t}}static async openArrayBuffer(t){const e=t.byteLength,r=new H(async(e,r)=>Buffer.from(t,e,r),async()=>{},e);try{await r.readHeader();const t=await r.readFooter();return new K(t,r)}catch(t){throw await r.close(),t}}constructor(t,e){if(V(this,"metadata",void 0),V(this,"envelopeReader",void 0),V(this,"schema",void 0),1!==t.version)throw new Error("invalid parquet version");this.metadata=t,this.envelopeReader=e;const r=this.metadata.schema[0],{schema:i}=function t(e,r,i){const n={};let o=r;for(let r=0;r<i;r++){const r=e[o],i=o>0?h.i(W,r.repetition_type):"ROOT";let s=!1,a=!1;switch(i){case"REQUIRED":break;case"OPTIONAL":s=!0;break;case"REPEATED":a=!0;break;default:throw new Error("parquet: unknown repetition type")}if(r.num_children>0){const i=t(e,o+1,r.num_children);o=i.next,n[r.name]={optional:s,repeated:a,fields:i.schema}}else{let t=h.i(F,r.type);r.converted_type&&(t=h.i(q,r.converted_type)),n[r.name]={type:t,typeLength:r.type_length,optional:s,repeated:a},o++}}return{schema:n,offset:r,next:o}}(this.metadata.schema,1,r.num_children);this.schema=new U(i)}async close(){await this.envelopeReader.close()}getCursor(t){return t||(t=[]),t=t.map(t=>Array.isArray(t)?t:[t]),new G(this.metadata,this.envelopeReader,this.schema,t)}getRowCount(){return Number(this.metadata.num_rows)}getSchema(){return this.schema}getMetadata(){const t={};for(const e of this.metadata.key_value_metadata)t[e.key]=e.value;return t}[Z](){return this.getCursor()[Symbol.asyncIterator]()}}class H{static async openFile(t){const e=await h.g(t),r=await h.e(t),i=h.f.bind(void 0,r),n=h.c.bind(void 0,r);return new H(i,n,e.size)}static async openBuffer(t){return new H((e,r)=>Promise.resolve(t.slice(e,e+r)),()=>Promise.resolve(),t.length)}constructor(t,e,r){V(this,"read",void 0),V(this,"close",void 0),V(this,"fileSize",void 0),this.read=t,this.close=e,this.fileSize=r}async readHeader(){if("PAR1"!==(await this.read(0,"PAR1".length)).toString())throw new Error("not valid parquet file")}async readRowGroup(t,e,r){const i={rowCount:Number(e.num_rows),columnData:{}};for(const n of e.columns){const e=n.meta_data,o=null==e?void 0:e.path_in_schema;r.length>0&&h.d(r,o)<0||(i.columnData[o.join()]=await this.readColumnChunk(t,n))}return i}async readColumnChunk(t,e){var r,i,n,o,s;if(void 0!==e.file_path&&null!==e.file_path)throw new Error("external references are not supported");const a=t.findField(null===(r=e.meta_data)||void 0===r?void 0:r.path_in_schema),u=h.i(F,null===(i=e.meta_data)||void 0===i?void 0:i.type);if(u!==a.primitiveType)throw new Error("chunk type not matching schema: "+u);const f=h.i(C,null===(n=e.meta_data)||void 0===n?void 0:n.codec),l=Number(null===(o=e.meta_data)||void 0===o?void 0:o.data_page_offset),c=Number(null===(s=e.meta_data)||void 0===s?void 0:s.total_compressed_size);return function(t,e,r){const i={buffer:t,offset:0,size:t.length},n={rlevels:[],dlevels:[],values:[],count:0};for(;i.offset<i.size;){const{pageHeader:t,length:o}=h.b(i.buffer);i.offset+=o;const s=h.i(j,t.type);let a=null;switch(s){case"DATA_PAGE":a=J(i,t,e,r);break;case"DATA_PAGE_V2":a=$(i,t,e,r);break;default:throw new Error("invalid page type: "+s)}Array.prototype.push.apply(n.rlevels,a.rlevels),Array.prototype.push.apply(n.dlevels,a.dlevels),Array.prototype.push.apply(n.values,a.values),n.count+=a.count}return n}(await this.read(l,c),a,f)}async readFooter(){const t="PAR1".length+4,e=await this.read(this.fileSize-t,t);if("PAR1"!==e.slice(4).toString())throw new Error("not a valid parquet file");const r=e.readUInt32LE(0),i=this.fileSize-r-t;if(i<"PAR1".length)throw new Error("invalid metadata size");const n=await this.read(i,r),{metadata:o}=h.a(n);return o}}function X(t,e,r,i,n){if(!(e in c))throw new Error("invalid encoding: "+e);return c[e].decodeValues(t,r,i,n)}function J(t,e,r,i){var n,o,s,a;const u=t.offset+e.compressed_page_size,f=null===(n=e.data_page_header)||void 0===n?void 0:n.num_values;let l=t;if("UNCOMPRESSED"!==i){const r=b(i,t.buffer.slice(t.offset,u),e.uncompressed_page_size);l={buffer:r,offset:0,size:r.length},t.offset=u}const c=h.i(z,null===(o=e.data_page_header)||void 0===o?void 0:o.repetition_level_encoding);let d=new Array(f);r.rLevelMax>0?d=X("INT32",c,l,f,{bitWidth:h.h(r.rLevelMax),disableEnvelope:!1}):d.fill(0);const p=h.i(z,null===(s=e.data_page_header)||void 0===s?void 0:s.definition_level_encoding);let _=new Array(f);r.dLevelMax>0?_=X("INT32",p,l,f,{bitWidth:h.h(r.dLevelMax),disableEnvelope:!1}):_.fill(0);let y=0;for(const t of _)t===r.dLevelMax&&y++;const w=h.i(z,null===(a=e.data_page_header)||void 0===a?void 0:a.encoding);return{dlevels:_,rlevels:d,values:X(r.primitiveType,w,l,y,{typeLength:r.typeLength,bitWidth:r.typeLength}),count:f}}function $(t,e,r,i){var n,o,s,a;const u=t.offset+e.compressed_page_size,f=null===(n=e.data_page_header_v2)||void 0===n?void 0:n.num_values,l=f-(null===(o=e.data_page_header_v2)||void 0===o?void 0:o.num_nulls),c=h.i(z,null===(s=e.data_page_header_v2)||void 0===s?void 0:s.encoding);let d=new Array(f);r.rLevelMax>0?d=X("INT32","RLE",t,f,{bitWidth:h.h(r.rLevelMax),disableEnvelope:!0}):d.fill(0);let p=new Array(f);r.dLevelMax>0?p=X("INT32","RLE",t,f,{bitWidth:h.h(r.dLevelMax),disableEnvelope:!0}):p.fill(0);let _=t;if(null!==(a=e.data_page_header_v2)&&void 0!==a&&a.is_compressed){const r=b(i,t.buffer.slice(t.offset,u),e.uncompressed_page_size);_={buffer:r,offset:0,size:r.length},t.offset=u}return{dlevels:p,rlevels:d,values:X(r.primitiveType,c,_,l,{typeLength:r.typeLength,bitWidth:r.typeLength}),count:f}}var Q=r(40),tt=r(117),et=r(63),rt=r(64),it=r(67),nt=r(66),ot=r(62),st=r(116),at=r(24),ut=r(65),ft=r(2),lt=r.n(ft);function ct(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}class ht{static async openFile(t,e,r){const i=await h.l(e,r);return ht.openStream(t,i,r)}static async openStream(t,e,r){r||(r={});const i=await dt.openStream(t,e,r);return new ht(t,i,r)}constructor(t,e,r){ct(this,"schema",void 0),ct(this,"envelopeWriter",void 0),ct(this,"rowBuffer",void 0),ct(this,"rowGroupSize",void 0),ct(this,"closed",void 0),ct(this,"userMetadata",void 0),this.schema=t,this.envelopeWriter=e,this.rowBuffer={},this.rowGroupSize=r.rowGroupSize||4096,this.closed=!1,this.userMetadata={};try{e.writeHeader()}catch(t){throw e.close(),t}}async appendRow(t){if(this.closed)throw new Error("writer was closed");x(this.schema,t,this.rowBuffer),this.rowBuffer.rowCount>=this.rowGroupSize&&(this.rowBuffer={})}async close(t){if(this.closed)throw new Error("writer was closed");this.closed=!0,(this.rowBuffer.rowCount>0||this.rowBuffer.rowCount>=this.rowGroupSize)&&(this.rowBuffer={}),await this.envelopeWriter.writeFooter(this.userMetadata),await this.envelopeWriter.close(),t&&t()}setMetadata(t,e){this.userMetadata[String(t)]=String(e)}setRowGroupSize(t){this.rowGroupSize=t}setPageSize(t){this.envelopeWriter.setPageSize(t)}}class dt{static async openStream(t,e,r){const i=h.m.bind(void 0,e),n=h.k.bind(void 0,e);return new dt(t,i,n,0,r)}constructor(t,e,r,i,n){ct(this,"schema",void 0),ct(this,"write",void 0),ct(this,"close",void 0),ct(this,"offset",void 0),ct(this,"rowCount",void 0),ct(this,"rowGroups",void 0),ct(this,"pageSize",void 0),ct(this,"useDataPageV2",void 0),this.schema=t,this.write=e,this.close=r,this.offset=i,this.rowCount=0,this.rowGroups=[],this.pageSize=n.pageSize||8192,this.useDataPageV2="useDataPageV2"in n&&Boolean(n.useDataPageV2)}writeSection(t){return this.offset+=t.length,this.write(t)}writeHeader(){return this.writeSection(Buffer.from("PAR1"))}async writeRowGroup(t){const e=function(t,e,r){const i=new nt.a({num_rows:e.rowCount,columns:[],total_byte_size:0});let n=Buffer.alloc(0);for(const o of t.fieldList){if(o.isNested)continue;const t=yt(o,e,n.length,r),s=new ot.a({file_offset:t.metadataOffset,meta_data:t.metadata});i.columns.push(s),i.total_byte_size=new lt.a(Number(i.total_byte_size)+t.body.length),n=Buffer.concat([n,t.body])}return{body:n,metadata:i}}(this.schema,t,{baseOffset:this.offset,pageSize:this.pageSize,useDataPageV2:this.useDataPageV2});return this.rowCount+=t.rowCount,this.rowGroups.push(e.metadata),this.writeSection(e.body)}writeFooter(t){return t||(t={}),this.writeSection(function(t,e,r,i){const n=new st.a({version:1,created_by:"parquets",num_rows:e,row_groups:r,schema:[],key_value_metadata:[]});for(const t in i){var o,s;const e=new at.a({key:t,value:i[t]});null===(o=n.key_value_metadata)||void 0===o||null===(s=o.push)||void 0===s||s.call(o,e)}{const e=new ut.a({name:"root",num_children:Object.keys(t.fields).length});n.schema.push(e)}for(const e of t.fieldList){const t=W[e.repetitionType],r=new ut.a({name:e.name,repetition_type:t});e.isNested?r.num_children=e.fieldCount:r.type=F[e.primitiveType],e.originalType&&(r.converted_type=q[e.originalType]),r.type_length=e.typeLength,n.schema.push(r)}const a=h.n(n),u=Buffer.alloc(a.length+8);return a.copy(u),u.writeUInt32LE(a.length,a.length),u.write("PAR1",a.length+4),u}(this.schema,this.rowCount,this.rowGroups,t))}setPageSize(t){this.pageSize=t}}class pt extends Q.Transform{constructor(t,e={}){super({objectMode:!0}),ct(this,"writer",void 0);const r=(i=this,async function(t){i.push(t)});var i;this.writer=new ht(t,new dt(t,r,async()=>{},0,e),e)}_transform(t,e,r){return t?this.writer.appendRow(t).then(r):(r(),Promise.resolve())}async _flush(t){await this.writer.close(t)}}function _t(t,e,r,i){if(!(e in c))throw new Error("invalid encoding: "+e);return c[e].encodeValues(t,r,i)}function yt(t,e,r,i){const n=e.columnData[t.path.join()],o=(i.baseOffset||0)+r;let s,a=0,u=0;{let r;r=i.useDataPageV2?function(t,e,r){const i=_t(t.primitiveType,t.encoding,e.values,{typeLength:t.typeLength,bitWidth:t.typeLength}),n=m(t.compression,i);let o=Buffer.alloc(0);t.rLevelMax>0&&(o=_t("INT32","RLE",e.rlevels,{bitWidth:h.h(t.rLevelMax),disableEnvelope:!0}));let s=Buffer.alloc(0);t.dLevelMax>0&&(s=_t("INT32","RLE",e.dlevels,{bitWidth:h.h(t.dLevelMax),disableEnvelope:!0}));const a=new tt.a({type:j.DATA_PAGE_V2,data_page_header_v2:new rt.a({num_values:e.count,num_nulls:e.count-e.values.length,num_rows:r,encoding:z[t.encoding],definition_levels_byte_length:s.length,repetition_levels_byte_length:o.length,is_compressed:"UNCOMPRESSED"!==t.compression}),uncompressed_page_size:o.length+s.length+i.length,compressed_page_size:o.length+s.length+n.length}),u=h.n(a),f=Buffer.concat([u,o,s,n]);return{header:a,headerSize:u.length,page:f}}(t,n,e.rowCount):function(t,e){let r=Buffer.alloc(0);t.rLevelMax>0&&(r=_t("INT32","RLE",e.rlevels,{bitWidth:h.h(t.rLevelMax)}));let i=Buffer.alloc(0);t.dLevelMax>0&&(i=_t("INT32","RLE",e.dlevels,{bitWidth:h.h(t.dLevelMax)}));const n=_t(t.primitiveType,t.encoding,e.values,{typeLength:t.typeLength,bitWidth:t.typeLength}),o=Buffer.concat([r,i,n]),s=m(t.compression,o),a=new tt.a({type:j.DATA_PAGE,data_page_header:new et.a({num_values:e.count,encoding:z[t.encoding],definition_level_encoding:z.RLE,repetition_level_encoding:z.RLE}),uncompressed_page_size:o.length,compressed_page_size:s.length}),u=h.n(a),f=Buffer.concat([u,s]);return{header:a,headerSize:u.length,page:f}}(t,n),s=r.page,a+=r.header.uncompressed_page_size+r.headerSize,u+=r.header.compressed_page_size+r.headerSize}const f=new it.a({path_in_schema:t.path,num_values:n.count,data_page_offset:o,encodings:[],total_uncompressed_size:a,total_compressed_size:u,type:F[t.primitiveType],codec:C[t.compression]});f.encodings.push(z.RLE),f.encodings.push(z[t.encoding]);const l=o+s.length;return{body:Buffer.concat([s,h.n(f)]),metadata:f,metadataOffset:l}}const wt={name:"Apache Parquet",id:"parquet",module:"parquet",version:"3.0.14",worker:!0,category:"table",extensions:["parquet"],mimeTypes:["application/octet-stream"],binary:!0,options:{parquet:{type:"object-row-table",url:void 0}}},gt={...wt,parse:async function(t,e){const r=await K.openArrayBuffer(t),i=[];try{const t=r.getCursor();let e;for(;e=await t.next();)i.push(e)}finally{await r.close()}return i}};const Tt={name:"Apache Parquet",id:"parquet",module:"parquet",version:"3.0.14",extensions:["parquet"],mimeTypes:["application/octet-stream"],encodeSync:function(t,e){return new ArrayBuffer(0)},binary:!0,options:{}}},function(t,e,r){"use strict";r.d(e,"a",(function(){return h}));var i=r(2),n=r.n(i),o=r(0);class s{constructor(){}write(t){t.writeStructBegin("TypeDefinedOrder"),t.writeFieldStop(),t.writeStructEnd()}static read(t){for(t.readStructBegin();;){const e=t.readFieldBegin(),r=e.ftype;e.fid;if(r===o.Thrift.Type.STOP)break;t.skip(r),t.readFieldEnd()}return t.readStructEnd(),new s}}class a{constructor(t){var e,r,i;i=void 0,(r="TYPE_ORDER")in(e=this)?Object.defineProperty(e,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[r]=i;let n=0;if(null!=t){if(null!=t.TYPE_ORDER&&(n++,this.TYPE_ORDER=t.TYPE_ORDER),n>1)throw new o.Thrift.TProtocolException(o.Thrift.TProtocolExceptionType.INVALID_DATA,"Cannot read a TUnion with more than one set value!");if(n<1)throw new o.Thrift.TProtocolException(o.Thrift.TProtocolExceptionType.INVALID_DATA,"Cannot read a TUnion with no set value!")}}static fromTYPE_ORDER(t){return new a({TYPE_ORDER:t})}write(t){t.writeStructBegin("ColumnOrder"),null!=this.TYPE_ORDER&&(t.writeFieldBegin("TYPE_ORDER",o.Thrift.Type.STRUCT,1),this.TYPE_ORDER.write(t),t.writeFieldEnd()),t.writeFieldStop(),t.writeStructEnd()}static read(t){let e=0,r=null;for(t.readStructBegin();;){const i=t.readFieldBegin(),n=i.ftype,u=i.fid;if(n===o.Thrift.Type.STOP)break;switch(u){case 1:if(n===o.Thrift.Type.STRUCT){e++;const i=s.read(t);r=a.fromTYPE_ORDER(i)}else t.skip(n);break;default:t.skip(n)}t.readFieldEnd()}if(t.readStructEnd(),e>1)throw new o.Thrift.TProtocolException(o.Thrift.TProtocolExceptionType.INVALID_DATA,"Cannot read a TUnion with more than one set value!");if(e<1)throw new o.Thrift.TProtocolException(o.Thrift.TProtocolExceptionType.INVALID_DATA,"Cannot read a TUnion with no set value!");if(null!==r)return r;throw new o.Thrift.TProtocolException(o.Thrift.TProtocolExceptionType.UNKNOWN,"Unable to read data for TUnion")}}var u=r(24),f=r(66),l=r(65);function c(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}class h{constructor(t=null){if(c(this,"version",void 0),c(this,"schema",void 0),c(this,"num_rows",void 0),c(this,"row_groups",void 0),c(this,"key_value_metadata",void 0),c(this,"created_by",void 0),c(this,"column_orders",void 0),null==t||null==t.version)throw new o.Thrift.TProtocolException(o.Thrift.TProtocolExceptionType.UNKNOWN,"Required field[version] is unset!");if(this.version=t.version,null==t||null==t.schema)throw new o.Thrift.TProtocolException(o.Thrift.TProtocolExceptionType.UNKNOWN,"Required field[schema] is unset!");if(this.schema=t.schema,null==t||null==t.num_rows)throw new o.Thrift.TProtocolException(o.Thrift.TProtocolExceptionType.UNKNOWN,"Required field[num_rows] is unset!");if("number"==typeof t.num_rows?this.num_rows=new n.a(t.num_rows):this.num_rows=t.num_rows,null==t||null==t.row_groups)throw new o.Thrift.TProtocolException(o.Thrift.TProtocolExceptionType.UNKNOWN,"Required field[row_groups] is unset!");this.row_groups=t.row_groups,null!=t&&null!=t.key_value_metadata&&(this.key_value_metadata=t.key_value_metadata),null!=t&&null!=t.created_by&&(this.created_by=t.created_by),null!=t&&null!=t.column_orders&&(this.column_orders=t.column_orders)}write(t){t.writeStructBegin("FileMetaData"),null!=this.version&&(t.writeFieldBegin("version",o.Thrift.Type.I32,1),t.writeI32(this.version),t.writeFieldEnd()),null!=this.schema&&(t.writeFieldBegin("schema",o.Thrift.Type.LIST,2),t.writeListBegin(o.Thrift.Type.STRUCT,this.schema.length),this.schema.forEach(e=>{e.write(t)}),t.writeListEnd(),t.writeFieldEnd()),null!=this.num_rows&&(t.writeFieldBegin("num_rows",o.Thrift.Type.I64,3),t.writeI64(this.num_rows),t.writeFieldEnd()),null!=this.row_groups&&(t.writeFieldBegin("row_groups",o.Thrift.Type.LIST,4),t.writeListBegin(o.Thrift.Type.STRUCT,this.row_groups.length),this.row_groups.forEach(e=>{e.write(t)}),t.writeListEnd(),t.writeFieldEnd()),null!=this.key_value_metadata&&(t.writeFieldBegin("key_value_metadata",o.Thrift.Type.LIST,5),t.writeListBegin(o.Thrift.Type.STRUCT,this.key_value_metadata.length),this.key_value_metadata.forEach(e=>{e.write(t)}),t.writeListEnd(),t.writeFieldEnd()),null!=this.created_by&&(t.writeFieldBegin("created_by",o.Thrift.Type.STRING,6),t.writeString(this.created_by),t.writeFieldEnd()),null!=this.column_orders&&(t.writeFieldBegin("column_orders",o.Thrift.Type.LIST,7),t.writeListBegin(o.Thrift.Type.STRUCT,this.column_orders.length),this.column_orders.forEach(e=>{e.write(t)}),t.writeListEnd(),t.writeFieldEnd()),t.writeFieldStop(),t.writeStructEnd()}static read(t){t.readStructBegin();let e={};for(;;){const r=t.readFieldBegin(),i=r.ftype,n=r.fid;if(i===o.Thrift.Type.STOP)break;switch(n){case 1:if(i===o.Thrift.Type.I32){const r=t.readI32();e.version=r}else t.skip(i);break;case 2:if(i===o.Thrift.Type.LIST){const r=new Array,i=t.readListBegin().size;for(let e=0;e<i;e++){const e=l.a.read(t);r.push(e)}t.readListEnd(),e.schema=r}else t.skip(i);break;case 3:if(i===o.Thrift.Type.I64){const r=t.readI64();e.num_rows=r}else t.skip(i);break;case 4:if(i===o.Thrift.Type.LIST){const r=new Array,i=t.readListBegin().size;for(let e=0;e<i;e++){const e=f.a.read(t);r.push(e)}t.readListEnd(),e.row_groups=r}else t.skip(i);break;case 5:if(i===o.Thrift.Type.LIST){const r=new Array,i=t.readListBegin().size;for(let e=0;e<i;e++){const e=u.a.read(t);r.push(e)}t.readListEnd(),e.key_value_metadata=r}else t.skip(i);break;case 6:if(i===o.Thrift.Type.STRING){const r=t.readString();e.created_by=r}else t.skip(i);break;case 7:if(i===o.Thrift.Type.LIST){const r=new Array,i=t.readListBegin().size;for(let e=0;e<i;e++){const e=a.read(t);r.push(e)}t.readListEnd(),e.column_orders=r}else t.skip(i);break;default:t.skip(i)}t.readFieldEnd()}if(t.readStructEnd(),void 0!==e.version&&void 0!==e.schema&&void 0!==e.num_rows&&void 0!==e.row_groups)return new h(e);throw new o.Thrift.TProtocolException(o.Thrift.TProtocolExceptionType.UNKNOWN,"Unable to read FileMetaData from input")}}},function(t,e,r){"use strict";r.d(e,"a",(function(){return l}));var i=r(0),n=r(63),o=r(64);function s(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}class a{constructor(t){if(s(this,"num_values",void 0),s(this,"encoding",void 0),s(this,"is_sorted",void 0),null==t||null==t.num_values)throw new i.Thrift.TProtocolException(i.Thrift.TProtocolExceptionType.UNKNOWN,"Required field[num_values] is unset!");if(this.num_values=t.num_values,null==t||null==t.encoding)throw new i.Thrift.TProtocolException(i.Thrift.TProtocolExceptionType.UNKNOWN,"Required field[encoding] is unset!");this.encoding=t.encoding,null!=t&&null!=t.is_sorted&&(this.is_sorted=t.is_sorted)}write(t){t.writeStructBegin("DictionaryPageHeader"),null!=this.num_values&&(t.writeFieldBegin("num_values",i.Thrift.Type.I32,1),t.writeI32(this.num_values),t.writeFieldEnd()),null!=this.encoding&&(t.writeFieldBegin("encoding",i.Thrift.Type.I32,2),t.writeI32(this.encoding),t.writeFieldEnd()),null!=this.is_sorted&&(t.writeFieldBegin("is_sorted",i.Thrift.Type.BOOL,3),t.writeBool(this.is_sorted),t.writeFieldEnd()),t.writeFieldStop(),t.writeStructEnd()}static read(t){t.readStructBegin();let e={};for(;;){const r=t.readFieldBegin(),n=r.ftype,o=r.fid;if(n===i.Thrift.Type.STOP)break;switch(o){case 1:if(n===i.Thrift.Type.I32){const r=t.readI32();e.num_values=r}else t.skip(n);break;case 2:if(n===i.Thrift.Type.I32){const r=t.readI32();e.encoding=r}else t.skip(n);break;case 3:if(n===i.Thrift.Type.BOOL){const r=t.readBool();e.is_sorted=r}else t.skip(n);break;default:t.skip(n)}t.readFieldEnd()}if(t.readStructEnd(),void 0!==e.num_values&&void 0!==e.encoding)return new a(e);throw new i.Thrift.TProtocolException(i.Thrift.TProtocolExceptionType.UNKNOWN,"Unable to read DictionaryPageHeader from input")}}class u{constructor(){}write(t){t.writeStructBegin("IndexPageHeader"),t.writeFieldStop(),t.writeStructEnd()}static read(t){for(t.readStructBegin();;){const e=t.readFieldBegin(),r=e.ftype;e.fid;if(r===i.Thrift.Type.STOP)break;t.skip(r),t.readFieldEnd()}return t.readStructEnd(),new u}}function f(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}class l{constructor(t){if(f(this,"type",void 0),f(this,"uncompressed_page_size",void 0),f(this,"compressed_page_size",void 0),f(this,"crc",void 0),f(this,"data_page_header",void 0),f(this,"index_page_header",void 0),f(this,"dictionary_page_header",void 0),f(this,"data_page_header_v2",void 0),null==t||null==t.type)throw new i.Thrift.TProtocolException(i.Thrift.TProtocolExceptionType.UNKNOWN,"Required field[type] is unset!");if(this.type=t.type,null==t||null==t.uncompressed_page_size)throw new i.Thrift.TProtocolException(i.Thrift.TProtocolExceptionType.UNKNOWN,"Required field[uncompressed_page_size] is unset!");if(this.uncompressed_page_size=t.uncompressed_page_size,null==t||null==t.compressed_page_size)throw new i.Thrift.TProtocolException(i.Thrift.TProtocolExceptionType.UNKNOWN,"Required field[compressed_page_size] is unset!");this.compressed_page_size=t.compressed_page_size,null!=t&&null!=t.crc&&(this.crc=t.crc),null!=t&&null!=t.data_page_header&&(this.data_page_header=t.data_page_header),null!=t&&null!=t.index_page_header&&(this.index_page_header=t.index_page_header),null!=t&&null!=t.dictionary_page_header&&(this.dictionary_page_header=t.dictionary_page_header),null!=t&&null!=t.data_page_header_v2&&(this.data_page_header_v2=t.data_page_header_v2)}write(t){t.writeStructBegin("PageHeader"),null!=this.type&&(t.writeFieldBegin("type",i.Thrift.Type.I32,1),t.writeI32(this.type),t.writeFieldEnd()),null!=this.uncompressed_page_size&&(t.writeFieldBegin("uncompressed_page_size",i.Thrift.Type.I32,2),t.writeI32(this.uncompressed_page_size),t.writeFieldEnd()),null!=this.compressed_page_size&&(t.writeFieldBegin("compressed_page_size",i.Thrift.Type.I32,3),t.writeI32(this.compressed_page_size),t.writeFieldEnd()),null!=this.crc&&(t.writeFieldBegin("crc",i.Thrift.Type.I32,4),t.writeI32(this.crc),t.writeFieldEnd()),null!=this.data_page_header&&(t.writeFieldBegin("data_page_header",i.Thrift.Type.STRUCT,5),this.data_page_header.write(t),t.writeFieldEnd()),null!=this.index_page_header&&(t.writeFieldBegin("index_page_header",i.Thrift.Type.STRUCT,6),this.index_page_header.write(t),t.writeFieldEnd()),null!=this.dictionary_page_header&&(t.writeFieldBegin("dictionary_page_header",i.Thrift.Type.STRUCT,7),this.dictionary_page_header.write(t),t.writeFieldEnd()),null!=this.data_page_header_v2&&(t.writeFieldBegin("data_page_header_v2",i.Thrift.Type.STRUCT,8),this.data_page_header_v2.write(t),t.writeFieldEnd()),t.writeFieldStop(),t.writeStructEnd()}static read(t){t.readStructBegin();let e={};for(;;){const r=t.readFieldBegin(),s=r.ftype,f=r.fid;if(s===i.Thrift.Type.STOP)break;switch(f){case 1:if(s===i.Thrift.Type.I32){const r=t.readI32();e.type=r}else t.skip(s);break;case 2:if(s===i.Thrift.Type.I32){const r=t.readI32();e.uncompressed_page_size=r}else t.skip(s);break;case 3:if(s===i.Thrift.Type.I32){const r=t.readI32();e.compressed_page_size=r}else t.skip(s);break;case 4:if(s===i.Thrift.Type.I32){const r=t.readI32();e.crc=r}else t.skip(s);break;case 5:if(s===i.Thrift.Type.STRUCT){const r=n.a.read(t);e.data_page_header=r}else t.skip(s);break;case 6:if(s===i.Thrift.Type.STRUCT){const r=u.read(t);e.index_page_header=r}else t.skip(s);break;case 7:if(s===i.Thrift.Type.STRUCT){const r=a.read(t);e.dictionary_page_header=r}else t.skip(s);break;case 8:if(s===i.Thrift.Type.STRUCT){const r=o.a.read(t);e.data_page_header_v2=r}else t.skip(s);break;default:t.skip(s)}t.readFieldEnd()}if(t.readStructEnd(),void 0!==e.type&&void 0!==e.uncompressed_page_size&&void 0!==e.compressed_page_size)return new l(e);throw new i.Thrift.TProtocolException(i.Thrift.TProtocolExceptionType.UNKNOWN,"Unable to read PageHeader from input")}}}])}));
|
|
51
51
|
//# sourceMappingURL=dist.min.js.map
|