From 711571ad8326dc52ad52481c02509af8ca660885 Mon Sep 17 00:00:00 2001 From: Paul Taylor Date: Mon, 26 Feb 2018 10:35:59 -0800 Subject: [PATCH] fix typo -- rename indicies to indices --- js/src/Arrow.externs.js | 2 +- js/src/data.ts | 22 +++++++++++----------- js/src/ipc/reader/vector.ts | 2 +- js/src/table.ts | 4 ++-- js/src/type.ts | 12 ++++++------ js/src/vector.ts | 12 ++++++------ js/src/vector/dictionary.ts | 24 ++++++++++++------------ 7 files changed, 39 insertions(+), 39 deletions(-) diff --git a/js/src/Arrow.externs.js b/js/src/Arrow.externs.js index de1e6539285..cf4db9134b9 100644 --- a/js/src/Arrow.externs.js +++ b/js/src/Arrow.externs.js @@ -447,7 +447,7 @@ FlatListData.prototype.valueOffsets; var DictionaryData = function() {}; /** @type {?} */ -DictionaryData.prototype.indicies; +DictionaryData.prototype.indices; /** @type {?} */ DictionaryData.prototype.dictionary; diff --git a/js/src/data.ts b/js/src/data.ts index d49fb790b9f..cdd9f29a7a9 100644 --- a/js/src/data.ts +++ b/js/src/data.ts @@ -148,28 +148,28 @@ export class FlatListData extends FlatData { export class DictionaryData extends BaseData> { protected _dictionary: Vector; - protected _indicies: Data>; - public get indicies() { return this._indicies; } + protected _indices: Data>; + public get indices() { return this._indices; } public get dictionary() { return this._dictionary; } - constructor(type: Dictionary, dictionary: Vector, indicies: Data>) { - super(type, indicies.length, (indicies as any)._nullCount); - this._indicies = indicies; + constructor(type: Dictionary, dictionary: Vector, indices: Data>) { + super(type, indices.length, (indices as any)._nullCount); + this._indices = indices; this._dictionary = dictionary; - this.length = this._indicies.length; + this.length = this._indices.length; } - public get nullCount() { return this._indicies.nullCount; } - public get nullBitmap() { return this._indicies.nullBitmap; } + public get nullCount() { return this._indices.nullCount; } + public get nullBitmap() { return this._indices.nullBitmap; } public clone>(type: R, length = this.length, offset = this.offset) { const data = this._dictionary.data.clone(type.dictionary as any); return new DictionaryData( this.type as any, this._dictionary.clone(data) as any, - this._indicies.slice(offset - this.offset, length) + this._indices.slice(offset - this.offset, length) ) as any; } protected sliceInternal(clone: this, _offset: number, _length: number) { - clone.length = clone._indicies.length; - clone._nullCount = (clone._indicies as any)._nullCount; + clone.length = clone._indices.length; + clone._nullCount = (clone._indices as any)._nullCount; return clone; } } diff --git a/js/src/ipc/reader/vector.ts b/js/src/ipc/reader/vector.ts index 809069c6d98..b8c4871ebac 100644 --- a/js/src/ipc/reader/vector.ts +++ b/js/src/ipc/reader/vector.ts @@ -92,7 +92,7 @@ export abstract class TypeDataLoader extends TypeVisitor { public visitFixedSizeList (type: FixedSizeList) { return this.visitFixedSizeListType(type); } public visitMap (type: Map_) { return this.visitNestedType(type); } public visitDictionary (type: Dictionary) { - return new DictionaryData(type, this.dictionaries.get(type.id)!, this.visit(type.indicies)); + return new DictionaryData(type, this.dictionaries.get(type.id)!, this.visit(type.indices)); } protected getFieldMetadata() { return this.nodes.next().value; } protected getBufferMetadata() { return this.buffers.next().value; } diff --git a/js/src/table.ts b/js/src/table.ts index 3e50d16e372..d0d699f366e 100644 --- a/js/src/table.ts +++ b/js/src/table.ts @@ -160,7 +160,7 @@ export class Table implements DataFrame { const batch = batches[batchIndex]; // rebind the countBy Col count_by.bind(batch); - const keys = (count_by.vector as DictionaryVector).indicies; + const keys = (count_by.vector as DictionaryVector).indices; // yield all indices for (let index = -1, numRows = batch.length; ++index < numRows;) { let key = keys.get(index); @@ -258,7 +258,7 @@ class FilteredDataFrame implements DataFrame { const predicate = this.predicate.bind(batch); // rebind the countBy Col count_by.bind(batch); - const keys = (count_by.vector as DictionaryVector).indicies; + const keys = (count_by.vector as DictionaryVector).indices; // yield all indices for (let index = -1, numRows = batch.length; ++index < numRows;) { let key = keys.get(index); diff --git a/js/src/type.ts b/js/src/type.ts index 5e6c939ef67..370be0def0c 100644 --- a/js/src/type.ts +++ b/js/src/type.ts @@ -83,8 +83,8 @@ export class Field { public toString() { return `${this.name}: ${this.type}`; } public get typeId(): T['TType'] { return this.type.TType; } public get [Symbol.toStringTag](): string { return 'Field'; } - public get indicies(): T | Int { - return DataType.isDictionary(this.type) ? this.type.indicies : this.type; + public get indices(): T | Int { + return DataType.isDictionary(this.type) ? this.type.indices : this.type; } } @@ -443,17 +443,17 @@ export interface Dictionary extends DataType extends DataType { public readonly id: number; public readonly dictionary: T; - public readonly indicies: Int; + public readonly indices: Int; public readonly isOrdered: boolean; - constructor(dictionary: T, indicies: Int, id?: Long | number | null, isOrdered?: boolean | null) { + constructor(dictionary: T, indices: Int, id?: Long | number | null, isOrdered?: boolean | null) { super(Type.Dictionary); - this.indicies = indicies; + this.indices = indices; this.dictionary = dictionary; this.isOrdered = isOrdered || false; this.id = id == null ? DictionaryBatch.getId() : typeof id === 'number' ? id : id.low; } public get ArrayType() { return this.dictionary.ArrayType; } - public toString() { return `Dictionary<${this.indicies}, ${this.dictionary}>`; } + public toString() { return `Dictionary<${this.indices}, ${this.dictionary}>`; } protected static [Symbol.toStringTag] = ((proto: Dictionary) => { return proto[Symbol.toStringTag] = 'Dictionary'; })(Dictionary.prototype); diff --git a/js/src/vector.ts b/js/src/vector.ts index fa1d16efcba..f36c691e1bd 100644 --- a/js/src/vector.ts +++ b/js/src/vector.ts @@ -394,29 +394,29 @@ export class UnionVector extends Nes export class DictionaryVector extends Vector> { // @ts-ignore - public readonly indicies: Vector; + public readonly indices: Vector; // @ts-ignore public readonly dictionary: Vector; - constructor(data: Data>, view: View> = new DictionaryView(data.dictionary, new IntVector(data.indicies))) { + constructor(data: Data>, view: View> = new DictionaryView(data.dictionary, new IntVector(data.indices))) { super(data as Data, view); if (data instanceof DictionaryData && view instanceof DictionaryView) { - this.indicies = view.indicies; + this.indices = view.indices; this.dictionary = data.dictionary; } else if (data instanceof ChunkedData && view instanceof ChunkedView) { const chunks = view.chunkVectors as DictionaryVector[]; // Assume the last chunk's dictionary data is the most up-to-date, // including data from DictionaryBatches that were marked as deltas this.dictionary = chunks[chunks.length - 1].dictionary; - this.indicies = chunks.reduce | null>( + this.indices = chunks.reduce | null>( (idxs: Vector | null, dict: DictionaryVector) => - !idxs ? dict.indicies! : idxs.concat(dict.indicies!), + !idxs ? dict.indices! : idxs.concat(dict.indices!), null )!; } else { throw new TypeError(`Unrecognized DictionaryVector view`); } } - public getKey(index: number) { return this.indicies.get(index); } + public getKey(index: number) { return this.indices.get(index); } public getValue(key: number) { return this.dictionary.get(key); } public reverseLookup(value: T) { return this.dictionary.indexOf(value); } } diff --git a/js/src/vector/dictionary.ts b/js/src/vector/dictionary.ts index f4de810b015..21f9bac0993 100644 --- a/js/src/vector/dictionary.ts +++ b/js/src/vector/dictionary.ts @@ -20,31 +20,31 @@ import { View, Vector } from '../vector'; import { IterableArrayLike, DataType, Dictionary, Int } from '../type'; export class DictionaryView implements View { - public indicies: Vector; + public indices: Vector; public dictionary: Vector; - constructor(dictionary: Vector, indicies: Vector) { - this.indicies = indicies; + constructor(dictionary: Vector, indices: Vector) { + this.indices = indices; this.dictionary = dictionary; } public clone(data: Data>): this { - return new DictionaryView(data.dictionary, this.indicies.clone(data.indicies)) as this; + return new DictionaryView(data.dictionary, this.indices.clone(data.indices)) as this; } public isValid(index: number): boolean { - return this.indicies.isValid(index); + return this.indices.isValid(index); } public get(index: number): T['TValue'] { - return this.dictionary.get(this.indicies.get(index)); + return this.dictionary.get(this.indices.get(index)); } public set(index: number, value: T['TValue']): void { - this.dictionary.set(this.indicies.get(index), value); + this.dictionary.set(this.indices.get(index), value); } public toArray(): IterableArrayLike { return [...this]; } public *[Symbol.iterator](): IterableIterator { - const values = this.dictionary, indicies = this.indicies; - for (let index = -1, n = indicies.length; ++index < n;) { - yield values.get(indicies.get(index)); + const values = this.dictionary, indices = this.indices; + for (let index = -1, n = indices.length; ++index < n;) { + yield values.get(indices.get(index)); } } public indexOf(search: T['TValue']) { @@ -52,7 +52,7 @@ export class DictionaryView implements View { const key = this.dictionary.indexOf(search); if (key === -1) { return key; } - // ... then find the first occurence of that key in indicies - return this.indicies.indexOf(key!); + // ... then find the first occurence of that key in indices + return this.indices.indexOf(key!); } }