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yEAAyE;IACzE,YAAY;IACZ,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC/B,MAAM,IAAI,GAAG,IAAI,UAAU,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAC/C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,EAAE;QACvC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;KACpD;IACD,OAAO,IAAI,CAAC;AAChB,CAAC","file":"vectorloader.js","sourcesContent":["// Licensed to the Apache Software Foundation (ASF) under one\n// or more contributor license agreements. See the NOTICE file\n// distributed with this work for additional information\n// regarding copyright ownership. The ASF licenses this file\n// to you under the Apache License, Version 2.0 (the\n// \"License\"); you may not use this file except in compliance\n// with the License. You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing,\n// software distributed under the License is distributed on an\n// \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n// KIND, either express or implied. See the License for the\n// specific language governing permissions and limitations\n// under the License.\n\nimport { Data } from '../data';\nimport * as type from '../type';\nimport { Field } from '../schema';\nimport { Vector } from '../vector';\nimport { DataType } from '../type';\nimport { Visitor } from '../visitor';\nimport { packBools } from '../util/bit';\nimport { encodeUtf8 } from '../util/utf8';\nimport { Int64, Int128 } from '../util/int';\nimport { UnionMode, DateUnit } from '../enum';\nimport { toArrayBufferView } from '../util/buffer';\nimport { BufferRegion, FieldNode } from '../ipc/metadata/message';\n\n/** @ignore */\nexport interface VectorLoader extends Visitor {\n visit<T extends DataType>(node: Field<T> | T): Data<T>;\n visitMany<T extends DataType>(nodes: (Field<T> | T)[]): Data<T>[];\n}\n\n/** @ignore */\nexport class VectorLoader extends Visitor {\n private bytes: Uint8Array;\n private nodes: FieldNode[];\n private nodesIndex: number = -1;\n private buffers: BufferRegion[];\n private buffersIndex: number = -1;\n private dictionaries: Map<number, Vector<any>>;\n constructor(bytes: Uint8Array, nodes: FieldNode[], buffers: BufferRegion[], dictionaries: Map<number, Vector<any>>) {\n super();\n this.bytes = bytes;\n this.nodes = nodes;\n this.buffers = buffers;\n this.dictionaries = dictionaries;\n }\n\n public visit<T extends DataType>(node: Field<T> | T): Data<T> {\n return super.visit(node instanceof Field ? node.type : node);\n }\n\n public visitNull <T extends type.Null> (type: T, { length, } = this.nextFieldNode()) { return Data.Null(type, 0, length); }\n public visitBool <T extends type.Bool> (type: T, { length, nullCount } = this.nextFieldNode()) { return Data.Bool(type, 0, length, nullCount, this.readNullBitmap(type, nullCount), this.readData(type)); }\n public visitInt <T extends type.Int> (type: T, { length, nullCount } = this.nextFieldNode()) { return Data.Int(type, 0, length, nullCount, this.readNullBitmap(type, nullCount), this.readData(type)); }\n public visitFloat <T extends type.Float> (type: T, { length, nullCount } = this.nextFieldNode()) { return Data.Float(type, 0, length, nullCount, this.readNullBitmap(type, nullCount), this.readData(type)); }\n public visitUtf8 <T extends type.Utf8> (type: T, { length, nullCount } = this.nextFieldNode()) { return Data.Utf8(type, 0, length, nullCount, this.readNullBitmap(type, nullCount), this.readOffsets(type), this.readData(type)); }\n public visitBinary <T extends type.Binary> (type: T, { length, nullCount } = this.nextFieldNode()) { return Data.Binary(type, 0, length, nullCount, this.readNullBitmap(type, nullCount), this.readOffsets(type), this.readData(type)); }\n public visitFixedSizeBinary <T extends type.FixedSizeBinary> (type: T, { length, nullCount } = this.nextFieldNode()) { return Data.FixedSizeBinary(type, 0, length, nullCount, this.readNullBitmap(type, nullCount), this.readData(type)); }\n public visitDate <T extends type.Date_> (type: T, { length, nullCount } = this.nextFieldNode()) { return Data.Date(type, 0, length, nullCount, this.readNullBitmap(type, nullCount), this.readData(type)); }\n public visitTimestamp <T extends type.Timestamp> (type: T, { length, nullCount } = this.nextFieldNode()) { return Data.Timestamp(type, 0, length, nullCount, this.readNullBitmap(type, nullCount), this.readData(type)); }\n public visitTime <T extends type.Time> (type: T, { length, nullCount } = this.nextFieldNode()) { return Data.Time(type, 0, length, nullCount, this.readNullBitmap(type, nullCount), this.readData(type)); }\n public visitDecimal <T extends type.Decimal> (type: T, { length, nullCount } = this.nextFieldNode()) { return Data.Decimal(type, 0, length, nullCount, this.readNullBitmap(type, nullCount), this.readData(type)); }\n public visitList <T extends type.List> (type: T, { length, nullCount } = this.nextFieldNode()) { return Data.List(type, 0, length, nullCount, this.readNullBitmap(type, nullCount), this.readOffsets(type), this.visit(type.children[0])); }\n public visitStruct <T extends type.Struct> (type: T, { length, nullCount } = this.nextFieldNode()) { return Data.Struct(type, 0, length, nullCount, this.readNullBitmap(type, nullCount), this.visitMany(type.children)); }\n public visitUnion <T extends type.Union> (type: T ) { return type.mode === UnionMode.Sparse ? this.visitSparseUnion(type as type.SparseUnion) : this.visitDenseUnion(type as type.DenseUnion); }\n public visitDenseUnion <T extends type.DenseUnion> (type: T, { length, nullCount } = this.nextFieldNode()) { return Data.Union(type, 0, length, nullCount, this.readNullBitmap(type, nullCount), this.readTypeIds(type), this.readOffsets(type), this.visitMany(type.children)); }\n public visitSparseUnion <T extends type.SparseUnion> (type: T, { length, nullCount } = this.nextFieldNode()) { return Data.Union(type, 0, length, nullCount, this.readNullBitmap(type, nullCount), this.readTypeIds(type), this.visitMany(type.children)); }\n public visitDictionary <T extends type.Dictionary> (type: T, { length, nullCount } = this.nextFieldNode()) { return Data.Dictionary(type, 0, length, nullCount, this.readNullBitmap(type, nullCount), this.readData(type.indices), this.readDictionary(type)); }\n public visitInterval <T extends type.Interval> (type: T, { length, nullCount } = this.nextFieldNode()) { return Data.Interval(type, 0, length, nullCount, this.readNullBitmap(type, nullCount), this.readData(type)); }\n public visitFixedSizeList <T extends type.FixedSizeList> (type: T, { length, nullCount } = this.nextFieldNode()) { return Data.FixedSizeList(type, 0, length, nullCount, this.readNullBitmap(type, nullCount), this.visit(type.children[0])); }\n public visitMap <T extends type.Map_> (type: T, { length, nullCount } = this.nextFieldNode()) { return Data.Map(type, 0, length, nullCount, this.readNullBitmap(type, nullCount), this.readOffsets(type), this.visit(type.children[0])); }\n\n protected nextFieldNode() { return this.nodes[++this.nodesIndex]; }\n protected nextBufferRange() { return this.buffers[++this.buffersIndex]; }\n protected readNullBitmap<T extends DataType>(type: T, nullCount: number, buffer = this.nextBufferRange()) {\n return nullCount > 0 && this.readData(type, buffer) || new Uint8Array(0);\n }\n protected readOffsets<T extends DataType>(type: T, buffer?: BufferRegion) { return this.readData(type, buffer); }\n protected readTypeIds<T extends DataType>(type: T, buffer?: BufferRegion) { return this.readData(type, buffer); }\n protected readData<T extends DataType>(_type: T, { length, offset } = this.nextBufferRange()) {\n return this.bytes.subarray(offset, offset + length);\n }\n protected readDictionary<T extends type.Dictionary>(type: T): Vector<T['dictionary']> {\n return this.dictionaries.get(type.id)!;\n }\n}\n\n/** @ignore */\nexport class JSONVectorLoader extends VectorLoader {\n private sources: any[][];\n constructor(sources: any[][], nodes: FieldNode[], buffers: BufferRegion[], dictionaries: Map<number, Vector<any>>) {\n super(new Uint8Array(0), nodes, buffers, dictionaries);\n this.sources = sources;\n }\n protected readNullBitmap<T extends DataType>(_type: T, nullCount: number, { offset } = this.nextBufferRange()) {\n return nullCount <= 0 ? new Uint8Array(0) : packBools(this.sources[offset]);\n }\n protected readOffsets<T extends DataType>(_type: T, { offset } = this.nextBufferRange()) {\n return toArrayBufferView(Uint8Array, toArrayBufferView(Int32Array, this.sources[offset]));\n }\n protected readTypeIds<T extends DataType>(type: T, { offset } = this.nextBufferRange()) {\n return toArrayBufferView(Uint8Array, toArrayBufferView(type.ArrayType, this.sources[offset]));\n }\n protected readData<T extends DataType>(type: T, { offset } = this.nextBufferRange()) {\n const { sources } = this;\n if (DataType.isTimestamp(type)) {\n return toArrayBufferView(Uint8Array, Int64.convertArray(sources[offset] as string[]));\n } else if ((DataType.isInt(type) || DataType.isTime(type)) && type.bitWidth === 64) {\n return toArrayBufferView(Uint8Array, Int64.convertArray(sources[offset] as string[]));\n } else if (DataType.isDate(type) && type.unit === DateUnit.MILLISECOND) {\n return toArrayBufferView(Uint8Array, Int64.convertArray(sources[offset] as string[]));\n } else if (DataType.isDecimal(type)) {\n return toArrayBufferView(Uint8Array, Int128.convertArray(sources[offset] as string[]));\n } else if (DataType.isBinary(type) || DataType.isFixedSizeBinary(type)) {\n return binaryDataFromJSON(sources[offset] as string[]);\n } else if (DataType.isBool(type)) {\n return packBools(sources[offset] as number[]);\n } else if (DataType.isUtf8(type)) {\n return encodeUtf8((sources[offset] as string[]).join(''));\n }\n return toArrayBufferView(Uint8Array, toArrayBufferView(type.ArrayType, sources[offset].map((x) => +x)));\n }\n}\n\n/** @ignore */\nfunction binaryDataFromJSON(values: string[]) {\n // \"DATA\": [\"49BC7D5B6C47D2\",\"3F5FB6D9322026\"]\n // There are definitely more efficient ways to do this... but it gets the\n // job done.\n const joined = values.join('');\n const data = new Uint8Array(joined.length / 2);\n for (let i = 0; i < joined.length; i += 2) {\n data[i >> 1] = parseInt(joined.substr(i, 2), 16);\n }\n return data;\n}\n"]}