dist/arquero.node.js
/**
   * Returns an array of indices for each group in the table.
   * If the table is not grouped, the result is the same as
   * {@link indices}, but wrapped within an array.
   * @param {boolean} [order=true] A flag indicating if the returned
   *  indices should be sorted if this table is ordered. If false, the
   *  returned indices may or may not be sorted.
   * @return {number[][]} An array of row index arrays, one per group.
   *  The indices will be filtered if the table is filtered.
   */
Returns an array of indices for each group in the table.
If the table is not grouped, the result is the same as
indices, but wrapped within an array.
@param {boolean} [order=true] A flag indicating if the returned
indices should be sorted if this table is ordered. If false, the
returned indices may or may not be sorted.
@return {number[][]} An array of row index arrays, one per group.
The indices will be filtered if the table is filtered.
Returns an array of indices for each group in the table . If the table is not grouped the result is the same as indices but wrapped within an array . @param { boolean } [ order = true ] A flag indicating if the returned indices should be sorted if this table is ordered . If false the returned indices may or may not be sorted . @return { number [] [] } An array of row index arrays one per group . The indices will be filtered if the table is filtered .
partitions(order = true) {
    if (this._partitions) {
      return this._partitions;
    }
    if (!this.isGrouped()) {
      return [ this.indices(order) ];
    }
    const { keys, size } = this._group;
    const part = repeat(size, () => []);
    const sort = this._index;
    const bits = this.mask();
    const n = this.numRows();
    if (sort && this.isOrdered()) {
      for (let i = 0, r; i < n; ++i) {
        r = sort[i];
        part[keys[r]].push(r);
      }
    } else if (bits) {
      for (let i = bits.next(0); i >= 0; i = bits.next(i + 1)) {
        part[keys[i]].push(i);
      }
    } else {
      for (let i = 0; i < n; ++i) {
        part[keys[i]].push(i);
      }
    }
    if (order && !sort && this.isOrdered()) {
      const compare = this._order;
      const data = this._data;
      for (let i = 0; i < size; ++i) {
        part[i].sort((a, b) => compare(a, b, data));
      }
    }
    if (order || !this.isOrdered()) {
      this._partitions = part;
    }
    return part;
  }
partitions ( order = true ) { if ( this . _partitions ) { return this . _partitions ; } if ( ! this . isGrouped ( ) ) { return [ this . indices ( order ) ] ; } const { keys , size } = this . _group ; const part = repeat ( size , ( ) => [ ] ) ; const sort = this . _index ; const bits = this . mask ( ) ; const n = this . numRows ( ) ; if ( sort && this . isOrdered ( ) ) { for ( let i = 0 , r ; i < n ; ++ i ) { r = sort [ i ] ; part [ keys [ r ] ] . push ( r ) ; } } else if ( bits ) { for ( let i = bits . next ( 0 ) ; i >= 0 ; i = bits . next ( i + 1 ) ) { part [ keys [ i ] ] . push ( i ) ; } } else { for ( let i = 0 ; i < n ; ++ i ) { part [ keys [ i ] ] . push ( i ) ; } } if ( order && ! sort && this . isOrdered ( ) ) { const compare = this . _order ; const data = this . _data ; for ( let i = 0 ; i < size ; ++ i ) { part [ i ] . sort ( ( a , b ) => compare ( a , b , data ) ) ; } } if ( order || ! this . isOrdered ( ) ) { this . _partitions = part ; } return part ; }
Returns an array of indices for each group in the table.
Returns an array of indices for each group in the table .
// return partitions if already generated // if not grouped, return a single partition // generate partitions // populate partitions, don't sort if indices don't exist // inline the following for performance: // this.scan(row => part[keys[row]].push(row), sort); // if ordered but not yet sorted, sort partitions directly // save partitions if they reflect table metadata