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,SAAS,CAAC,UAAU,GAA4B,YAAY,CAAC;AAC5E,cAAc,CAAC,SAAS,CAAC,eAAe,GAAuB,YAAY,CAAC;AAC5E,cAAc,CAAC,SAAS,CAAC,gBAAgB,GAAsB,YAAY,CAAC;AAC5E,cAAc,CAAC,SAAS,CAAC,eAAe,GAAkB,iBAAiB,CAAC;AAC5E,cAAc,CAAC,SAAS,CAAC,aAAa,GAAsB,eAAe,CAAC;AAC5E,cAAc,CAAC,SAAS,CAAC,oBAAoB,GAAe,eAAe,CAAC;AAC5E,cAAc,CAAC,SAAS,CAAC,sBAAsB,GAAa,eAAe,CAAC;AAC5E,cAAc,CAAC,SAAS,CAAC,kBAAkB,GAAY,oBAAoB,CAAC;AAC5E,cAAc,CAAC,SAAS,CAAC,QAAQ,GAAgC,UAAU,CAAC;AAE5E,cAAc;AACd,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,cAAc,EAAE,CAAC","file":"typecomparator.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 { Visitor } from '../visitor';\nimport { VectorType } from '../interfaces';\nimport { Schema, Field } from '../schema';\nimport {\n    DataType, Dictionary,\n    Bool, Null, Utf8, Binary, Decimal, FixedSizeBinary, List, FixedSizeList, Map_, Struct,\n    Float, Float16, Float32, Float64,\n    Int, Uint8, Uint16, Uint32, Uint64, Int8, Int16, Int32, Int64,\n    Date_, DateDay, DateMillisecond,\n    Interval, IntervalDayTime, IntervalYearMonth,\n    Time, TimeSecond, TimeMillisecond, TimeMicrosecond, TimeNanosecond,\n    Timestamp, TimestampSecond, TimestampMillisecond, TimestampMicrosecond, TimestampNanosecond,\n    Union, DenseUnion, SparseUnion,\n} from '../type';\n\n/** @ignore */\nexport interface TypeComparator extends Visitor {\n    visit<T extends DataType>(type: T, other?: DataType | null): other is T;\n    visitMany<T extends DataType>(nodes: T[], others?: DataType[] | null): boolean[];\n    getVisitFn<T extends DataType>(node: VectorType<T> |  Data<T> | T): (other?: DataType | null) => other is T;\n    visitNull                 <T extends Null>                 (type: T, other?: DataType | null): other is T;\n    visitBool                 <T extends Bool>                 (type: T, other?: DataType | null): other is T;\n    visitInt                  <T extends Int>                  (type: T, other?: DataType | null): other is T;\n    visitInt8                 <T extends Int8>                 (type: T, other?: DataType | null): other is T;\n    visitInt16                <T extends Int16>                (type: T, other?: DataType | null): other is T;\n    visitInt32                <T extends Int32>                (type: T, other?: DataType | null): other is T;\n    visitInt64                <T extends Int64>                (type: T, other?: DataType | null): other is T;\n    visitUint8                <T extends Uint8>                (type: T, other?: DataType | null): other is T;\n    visitUint16               <T extends Uint16>               (type: T, other?: DataType | null): other is T;\n    visitUint32               <T extends Uint32>               (type: T, other?: DataType | null): other is T;\n    visitUint64               <T extends Uint64>               (type: T, other?: DataType | null): other is T;\n    visitFloat                <T extends Float>                (type: T, other?: DataType | null): other is T;\n    visitFloat16              <T extends Float16>              (type: T, other?: DataType | null): other is T;\n    visitFloat32              <T extends Float32>              (type: T, other?: DataType | null): other is T;\n    visitFloat64              <T extends Float64>              (type: T, other?: DataType | null): other is T;\n    visitUtf8                 <T extends Utf8>                 (type: T, other?: DataType | null): other is T;\n    visitBinary               <T extends Binary>               (type: T, other?: DataType | null): other is T;\n    visitFixedSizeBinary      <T extends FixedSizeBinary>      (type: T, other?: DataType | null): other is T;\n    visitDate                 <T extends Date_>                (type: T, other?: DataType | null): other is T;\n    visitDateDay              <T extends DateDay>              (type: T, other?: DataType | null): other is T;\n    visitDateMillisecond      <T extends DateMillisecond>      (type: T, other?: DataType | null): other is T;\n    visitTimestamp            <T extends Timestamp>            (type: T, other?: DataType | null): other is T;\n    visitTimestampSecond      <T extends TimestampSecond>      (type: T, other?: DataType | null): other is T;\n    visitTimestampMillisecond <T extends TimestampMillisecond> (type: T, other?: DataType | null): other is T;\n    visitTimestampMicrosecond <T extends TimestampMicrosecond> (type: T, other?: DataType | null): other is T;\n    visitTimestampNanosecond  <T extends TimestampNanosecond>  (type: T, other?: DataType | null): other is T;\n    visitTime                 <T extends Time>                 (type: T, other?: DataType | null): other is T;\n    visitTimeSecond           <T extends TimeSecond>           (type: T, other?: DataType | null): other is T;\n    visitTimeMillisecond      <T extends TimeMillisecond>      (type: T, other?: DataType | null): other is T;\n    visitTimeMicrosecond      <T extends TimeMicrosecond>      (type: T, other?: DataType | null): other is T;\n    visitTimeNanosecond       <T extends TimeNanosecond>       (type: T, other?: DataType | null): other is T;\n    visitDecimal              <T extends Decimal>              (type: T, other?: DataType | null): other is T;\n    visitList                 <T extends List>                 (type: T, other?: DataType | null): other is T;\n    visitStruct               <T extends Struct>               (type: T, other?: DataType | null): other is T;\n    visitUnion                <T extends Union>                (type: T, other?: DataType | null): other is T;\n    visitDenseUnion           <T extends DenseUnion>           (type: T, other?: DataType | null): other is T;\n    visitSparseUnion          <T extends SparseUnion>          (type: T, other?: DataType | null): other is T;\n    visitDictionary           <T extends Dictionary>           (type: T, other?: DataType | null): other is T;\n    visitInterval             <T extends Interval>             (type: T, other?: DataType | null): other is T;\n    visitIntervalDayTime      <T extends IntervalDayTime>      (type: T, other?: DataType | null): other is T;\n    visitIntervalYearMonth    <T extends IntervalYearMonth>    (type: T, other?: DataType | null): other is T;\n    visitFixedSizeList        <T extends FixedSizeList>        (type: T, other?: DataType | null): other is T;\n    visitMap                  <T extends Map_>                 (type: T, other?: DataType | null): other is T;\n}\n\n/** @ignore */\nexport class TypeComparator extends Visitor {\n    compareSchemas<T extends { [key: string]: DataType }>(schema: Schema<T>, other?: Schema | null): other is Schema<T> {\n        return (schema === other) || (\n            other instanceof schema.constructor &&\n            instance.compareFields(schema.fields, other.fields)\n        );\n    }\n    compareFields<T extends { [key: string]: DataType }>(fields: Field<T[keyof T]>[], others?: Field[] | null): others is Field<T[keyof T]>[] {\n        return (fields === others) || (\n            Array.isArray(fields) &&\n            Array.isArray(others) &&\n            fields.length === others.length &&\n            fields.every((f, i) => instance.compareField(f, others[i]))\n        );\n    }\n    compareField<T extends DataType = any>(field: Field<T>, other?: Field | null): other is Field<T> {\n        return (field === other) || (\n            other instanceof field.constructor &&\n            field.name === other.name &&\n            field.nullable === other.nullable &&\n            instance.visit(field.type, other.type)\n        );\n    }\n}\n\nfunction compareConstructor<T extends DataType>(type: T, other?: DataType | null): other is T {\n    return other instanceof type.constructor;\n}\n\nfunction compareAny<T extends DataType>(type: T, other?: DataType | null): other is T {\n    return (type === other) || compareConstructor(type, other);\n}\n\nfunction compareInt<T extends Int>(type: T, other?: DataType | null): other is T {\n    return (type === other) || (\n        compareConstructor(type, other) &&\n        type.bitWidth === other.bitWidth &&\n        type.isSigned === other.isSigned\n    );\n}\n\nfunction compareFloat<T extends Float>(type: T, other?: DataType | null): other is T {\n    return (type === other) || (\n        compareConstructor(type, other) &&\n        type.precision === other.precision\n    );\n}\n\nfunction compareFixedSizeBinary<T extends FixedSizeBinary>(type: T, other?: DataType | null): other is T {\n    return (type === other) || (\n        compareConstructor(type, other) &&\n        type.byteWidth === other.byteWidth\n    );\n}\n\nfunction compareDate<T extends Date_>(type: T, other?: DataType | null): other is T {\n    return (type === other) || (\n        compareConstructor(type, other) &&\n        type.unit === other.unit\n    );\n}\n\nfunction compareTimestamp<T extends Timestamp>(type: T, other?: DataType | null): other is T {\n    return (type === other) || (\n        compareConstructor(type, other) &&\n        type.unit === other.unit &&\n        type.timezone === other.timezone\n    );\n}\n\nfunction compareTime<T extends Time>(type: T, other?: DataType | null): other is T {\n    return (type === other) || (\n        compareConstructor(type, other) &&\n        type.unit === other.unit &&\n        type.bitWidth === other.bitWidth\n    );\n}\n\nfunction compareList<T extends List>(type: T, other?: DataType | null): other is T {\n    return (type === other) || (\n        compareConstructor(type, other) &&\n        type.children.length === other.children.length &&\n        instance.compareFields(type.children, other.children)\n    );\n}\n\nfunction compareStruct<T extends Struct>(type: T, other?: DataType | null): other is T {\n    return (type === other) || (\n        compareConstructor(type, other) &&\n        type.children.length === other.children.length &&\n        instance.compareFields(type.children, other.children)\n    );\n}\n\nfunction compareUnion<T extends Union>(type: T, other?: DataType | null): other is T {\n    return (type === other) || (\n        compareConstructor(type, other) &&\n        type.mode === other.mode &&\n        type.typeIds.every((x, i) => x === other.typeIds[i]) &&\n        instance.compareFields(type.children, other.children)\n    );\n}\n\nfunction compareDictionary<T extends Dictionary>(type: T, other?: DataType | null): other is T {\n    return (type === other) || (\n        compareConstructor(type, other) &&\n        type.id === other.id &&\n        type.isOrdered === other.isOrdered &&\n        instance.visit(<any> type.indices, other.indices) &&\n        instance.visit(type.dictionary, other.dictionary)\n    );\n}\n\nfunction compareInterval<T extends Interval>(type: T, other?: DataType | null): other is T {\n    return (type === other) || (\n        compareConstructor(type, other) &&\n        type.unit === other.unit\n    );\n}\n\nfunction compareFixedSizeList<T extends FixedSizeList>(type: T, other?: DataType | null): other is T {\n    return (type === other) || (\n        compareConstructor(type, other) &&\n        type.listSize === other.listSize &&\n        type.children.length === other.children.length &&\n        instance.compareFields(type.children, other.children)\n    );\n}\n\nfunction compareMap<T extends Map_>(type: T, other?: DataType | null): other is T {\n    return (type === other) || (\n        compareConstructor(type, other) &&\n        type.keysSorted === other.keysSorted &&\n        type.children.length === other.children.length &&\n        instance.compareFields(type.children, other.children)\n    );\n}\n\nTypeComparator.prototype.visitNull                 =             compareAny;\nTypeComparator.prototype.visitBool                 =             compareAny;\nTypeComparator.prototype.visitInt                  =             compareInt;\nTypeComparator.prototype.visitInt8                 =             compareInt;\nTypeComparator.prototype.visitInt16                =             compareInt;\nTypeComparator.prototype.visitInt32                =             compareInt;\nTypeComparator.prototype.visitInt64                =             compareInt;\nTypeComparator.prototype.visitUint8                =             compareInt;\nTypeComparator.prototype.visitUint16               =             compareInt;\nTypeComparator.prototype.visitUint32               =             compareInt;\nTypeComparator.prototype.visitUint64               =             compareInt;\nTypeComparator.prototype.visitFloat                =           compareFloat;\nTypeComparator.prototype.visitFloat16              =           compareFloat;\nTypeComparator.prototype.visitFloat32              =           compareFloat;\nTypeComparator.prototype.visitFloat64              =           compareFloat;\nTypeComparator.prototype.visitUtf8                 =             compareAny;\nTypeComparator.prototype.visitBinary               =             compareAny;\nTypeComparator.prototype.visitFixedSizeBinary      = compareFixedSizeBinary;\nTypeComparator.prototype.visitDate                 =            compareDate;\nTypeComparator.prototype.visitDateDay              =            compareDate;\nTypeComparator.prototype.visitDateMillisecond      =            compareDate;\nTypeComparator.prototype.visitTimestamp            =       compareTimestamp;\nTypeComparator.prototype.visitTimestampSecond      =       compareTimestamp;\nTypeComparator.prototype.visitTimestampMillisecond =       compareTimestamp;\nTypeComparator.prototype.visitTimestampMicrosecond =       compareTimestamp;\nTypeComparator.prototype.visitTimestampNanosecond  =       compareTimestamp;\nTypeComparator.prototype.visitTime                 =            compareTime;\nTypeComparator.prototype.visitTimeSecond           =            compareTime;\nTypeComparator.prototype.visitTimeMillisecond      =            compareTime;\nTypeComparator.prototype.visitTimeMicrosecond      =            compareTime;\nTypeComparator.prototype.visitTimeNanosecond       =            compareTime;\nTypeComparator.prototype.visitDecimal              =             compareAny;\nTypeComparator.prototype.visitList                 =            compareList;\nTypeComparator.prototype.visitStruct               =          compareStruct;\nTypeComparator.prototype.visitUnion                =           compareUnion;\nTypeComparator.prototype.visitDenseUnion           =           compareUnion;\nTypeComparator.prototype.visitSparseUnion          =           compareUnion;\nTypeComparator.prototype.visitDictionary           =      compareDictionary;\nTypeComparator.prototype.visitInterval             =        compareInterval;\nTypeComparator.prototype.visitIntervalDayTime      =        compareInterval;\nTypeComparator.prototype.visitIntervalYearMonth    =        compareInterval;\nTypeComparator.prototype.visitFixedSizeList        =   compareFixedSizeList;\nTypeComparator.prototype.visitMap                  =             compareMap;\n\n/** @ignore */\nexport const instance = new TypeComparator();\n"]}