private ColumnChunk readArray(GroupField field) throws IOException { List<Type> parameters = field.getType().getTypeParameters(); checkArgument(parameters.size() == 1, "Arrays must have a single type parameter, found %d", parameters.size()); Field elementField = field.getChildren().get(0).get(); ColumnChunk columnChunk = readColumnChunk(elementField); IntList offsets = new IntArrayList(); BooleanList valueIsNull = new BooleanArrayList(); calculateCollectionOffsets(field, offsets, valueIsNull, columnChunk.getDefinitionLevels(), columnChunk.getRepetitionLevels()); Block arrayBlock = ArrayBlock.fromElementBlock(valueIsNull.size(), Optional.of(valueIsNull.toBooleanArray()), offsets.toIntArray(), columnChunk.getBlock()); return new ColumnChunk(arrayBlock, columnChunk.getDefinitionLevels(), columnChunk.getRepetitionLevels()); }
for (int index = 0; index < expectedValues.size(); index++) { boolean expectedValue = expectedValues.getBoolean(index); boolean actualValue = readValue(valueStream);
@Override public long size64() { return list.size(); } @Override
@Override public void size(final int size) { list.size(size); } @Override
@Override public void size(final int size) { synchronized (sync) { list.size(size); } } @Override
public long length() { return list.size(); }
public long length() { return list.size(); }
public BitVector length( final long numBits ) { if ( numBits > Integer.MAX_VALUE ) throw new IllegalArgumentException( "This BitVector implementation accepts integer indices only" ); list.size( (int)numBits ); return this; } }
public BitVector ensureCapacity( final long numBits ) { if ( numBits > Integer.MAX_VALUE ) throw new IllegalArgumentException( "This BitVector implementation accepts integer indices only" ); list.size( (int)numBits ); return this; }
public BitVector length( final long numBits ) { if ( numBits > Integer.MAX_VALUE ) throw new IllegalArgumentException( "This BitVector implementation accepts integer indices only" ); list.size( (int)numBits ); return this; } }
public BitVector ensureCapacity( final long numBits ) { if ( numBits > Integer.MAX_VALUE ) throw new IllegalArgumentException( "This BitVector implementation accepts integer indices only" ); list.size( (int)numBits ); return this; }
@Override public void size(final long size) { list.size(intIndex(size)); } @Override
@Override public boolean addAll(final int index, final BooleanList l) { ensureIndex(index); final int n = l.size(); if (n == 0) return false; grow(size + n); if (index != size) System.arraycopy(a, index, a, index + n, size - index); l.getElements(0, a, index, n); size += n; assert size <= a.length; return true; } @Override
/** * Shuffles the specified list using the specified pseudorandom number * generator. * * @param l * the list to be shuffled. * @param random * a pseudorandom number generator. * @return {@code l}. */ public static BooleanList shuffle(final BooleanList l, final Random random) { for (int i = l.size(); i-- != 0;) { final int p = random.nextInt(i + 1); final boolean t = l.getBoolean(i); l.set(i, l.getBoolean(p)); l.set(p, t); } return l; } /**
private ColumnChunk readArray(GroupField field) throws IOException { List<Type> parameters = field.getType().getTypeParameters(); checkArgument(parameters.size() == 1, "Arrays must have a single type parameter, found %d", parameters.size()); Field elementField = field.getChildren().get(0).get(); ColumnChunk columnChunk = readColumnChunk(elementField); IntList offsets = new IntArrayList(); BooleanList valueIsNull = new BooleanArrayList(); calculateCollectionOffsets(field, offsets, valueIsNull, columnChunk.getDefinitionLevels(), columnChunk.getRepetitionLevels()); Block arrayBlock = ArrayBlock.fromElementBlock(valueIsNull.size(), Optional.of(valueIsNull.toBooleanArray()), offsets.toIntArray(), columnChunk.getBlock()); return new ColumnChunk(arrayBlock, columnChunk.getDefinitionLevels(), columnChunk.getRepetitionLevels()); }
private ColumnChunk readArray(GroupField field) throws IOException { List<Type> parameters = field.getType().getTypeParameters(); checkArgument(parameters.size() == 1, "Arrays must have a single type parameter, found %d", parameters.size()); Field elementField = field.getChildren().get(0).get(); ColumnChunk columnChunk = readColumnChunk(elementField); IntList offsets = new IntArrayList(); BooleanList valueIsNull = new BooleanArrayList(); calculateCollectionOffsets(field, offsets, valueIsNull, columnChunk.getDefinitionLevels(), columnChunk.getRepetitionLevels()); Block arrayBlock = ArrayBlock.fromElementBlock(valueIsNull.size(), Optional.of(valueIsNull.toBooleanArray()), offsets.toIntArray(), columnChunk.getBlock()); return new ColumnChunk(arrayBlock, columnChunk.getDefinitionLevels(), columnChunk.getRepetitionLevels()); }
for (int index = 0; index < expectedValues.size(); index++) { boolean expectedValue = expectedValues.getBoolean(index); boolean actualValue = readValue(valueStream);
for (int index = 0; index < expectedValues.size(); index++) { boolean expectedValue = expectedValues.getBoolean(index); boolean actualValue = readValue(valueStream);