/** toString for MemoryHungry Measure is expensive, please invoke carefully */ public String toString(ImmutableBitSet selectedColumns) { Object[] values = new Object[selectedColumns.cardinality()]; getValues(selectedColumns, values); return Arrays.toString(values); }
void validate() { if (codeSystem == null) throw new IllegalStateException(); if (primaryKey == null || primaryKey.cardinality() == 0) throw new IllegalStateException(); codeSystem.init(this); validateColumnBlocks(); }
/** set record to the codes of specified values, reuse given space to hold the codes */ public GTRecord setValues(ImmutableBitSet selectedCols, ByteArray space, Object... values) { assert selectedCols.cardinality() == values.length; ByteBuffer buf = space.asBuffer(); int pos = buf.position(); for (int i = 0; i < selectedCols.trueBitCount(); i++) { int c = selectedCols.trueBitAt(i); info.codeSystem.encodeColumnValue(c, values[i], buf); int newPos = buf.position(); cols[c].reset(buf.array(), buf.arrayOffset() + pos, newPos - pos); pos = newPos; } return this; }
/** decode and return the values of this record */ public Object[] getValues(ImmutableBitSet selectedCols, Object[] result) { assert selectedCols.cardinality() == result.length; for (int i = 0; i < selectedCols.trueBitCount(); i++) { result[i] = decodeValue(selectedCols.trueBitAt(i)); } return result; }
private void validate(GTInfo info) { if (hasAggregation()) { if (aggrGroupBy.intersects(aggrMetrics) || aggrGroupBy.intersects(rtAggrMetrics)) throw new IllegalStateException(); if (aggrMetrics.cardinality() != aggrMetricsFuncs.length) throw new IllegalStateException(); if (columns == null) columns = ImmutableBitSet.EMPTY; columns = columns.or(aggrGroupBy); columns = columns.or(aggrMetrics); } if (columns == null) columns = info.colAll; if (hasFilterPushDown()) { validateFilterPushDown(info); } this.selectedColBlocks = info.selectColumnBlocks(columns.or(rtAggrMetrics).andNot(dynamicCols)); }
/** toString for MemoryHungry Measure is expensive, please invoke carefully */ public String toString(ImmutableBitSet selectedColumns) { Object[] values = new Object[selectedColumns.cardinality()]; getValues(selectedColumns, values); return Arrays.toString(values); }
void validate() { if (codeSystem == null) throw new IllegalStateException(); if (primaryKey == null || primaryKey.cardinality() == 0) throw new IllegalStateException(); codeSystem.init(this); validateColumnBlocks(); }
/** set record to the codes of specified values, reuse given space to hold the codes */ public GTRecord setValues(ImmutableBitSet selectedCols, ByteArray space, Object... values) { assert selectedCols.cardinality() == values.length; ByteBuffer buf = space.asBuffer(); int pos = buf.position(); for (int i = 0; i < selectedCols.trueBitCount(); i++) { int c = selectedCols.trueBitAt(i); info.codeSystem.encodeColumnValue(c, values[i], buf); int newPos = buf.position(); cols[c].reset(buf.array(), buf.arrayOffset() + pos, newPos - pos); pos = newPos; } return this; }
/** decode and return the values of this record */ public Object[] getValues(ImmutableBitSet selectedCols, Object[] result) { assert selectedCols.cardinality() == result.length; for (int i = 0; i < selectedCols.trueBitCount(); i++) { result[i] = decodeValue(selectedCols.trueBitAt(i)); } return result; }
private void validate(GTInfo info) { if (hasAggregation()) { if (aggrGroupBy.intersects(aggrMetrics) || aggrGroupBy.intersects(rtAggrMetrics)) throw new IllegalStateException(); if (aggrMetrics.cardinality() != aggrMetricsFuncs.length) throw new IllegalStateException(); if (columns == null) columns = ImmutableBitSet.EMPTY; columns = columns.or(aggrGroupBy); columns = columns.or(aggrMetrics); } if (columns == null) columns = info.colAll; if (hasFilterPushDown()) { validateFilterPushDown(info); } this.selectedColBlocks = info.selectColumnBlocks(columns.or(rtAggrMetrics).andNot(dynamicCols)); }