congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
ValueVector.setValueCount
Code IndexAdd Tabnine to your IDE (free)

How to use
setValueCount
method
in
org.apache.arrow.vector.ValueVector

Best Java code snippets using org.apache.arrow.vector.ValueVector.setValueCount (Showing top 20 results out of 315)

origin: dremio/dremio-oss

public void setValueCount(int valueCount){
 vector.setValueCount(valueCount);
}
origin: dremio/dremio-oss

private void setValueCount(int count) {
 for (ValueVector v : allocationVectors) {
  v.setValueCount(count);
 }
 if(flattenVector != null){
  flattenVector.setValueCount(count);
 }
 if (complexWriters != null) {
  for (ComplexWriter writer : complexWriters) {
   writer.setValueCount(count);
  }
 }
}
origin: dremio/dremio-oss

private void setOutputRowCount(int count) {
 for (ValueVector vv : familyVectorMap.values()) {
  vv.setValueCount(count);
 }
 if (rowKeyVector != null) {
  rowKeyVector.setValueCount(count);
 }
}
origin: dremio/dremio-oss

private void setValueCount(int numRecords) {
 for(ValueVector vv : allocationVectors) {
  vv.setValueCount(numRecords);
 }
 for (final ComplexWriter writer : complexWriters) {
  writer.setValueCount(numRecords);
 }
}
origin: dremio/dremio-oss

private void setValueCount(final int count) {
 for (final ValueVector v : allocationVectors) {
  v.setValueCount(count);
 }
 for (final ComplexWriter writer : complexWriters) {
  writer.setValueCount(count);
 }
}
origin: dremio/dremio-oss

private void setValueCount() {
 for (VectorWrapper<?> vw : htContainer) {
  ValueVector vv = vw.getValueVector();
  vv.setValueCount(maxOccupiedIdx + 1);
 }
}
origin: dremio/dremio-oss

private void setValueCount(int count) {
 for (VectorWrapper<?> w: outgoing) {
  w.getValueVector().setValueCount(count);
 }
}
origin: org.apache.arrow/arrow-vector

@Override
public void setValueCount(int valueCount) {
 for (final ValueVector v : getChildren()) {
  v.setValueCount(valueCount);
 }
 NonNullableStructVector.this.valueCount = valueCount;
}
origin: dremio/dremio-oss

public int setAllCount(int records){
 if(records != 0){
  for(VectorWrapper<?> w : this){
   w.getValueVector().setValueCount(records);
  }
 }
 setRecordCount(records);
 return records;
}
origin: dremio/dremio-oss

@Override
public int outputBatch(int batchIndex) {
 assert batchIndex <= batchHolders.size();
 final BatchHolder valueHolder = batchHolders.get(batchIndex);
 final int recordCount = valueHolder.getRecordCount();
 allocateOutgoing(recordCount);
 valueHolder.outputValues();
 htable.outputKeys(batchIndex, outContainer);
 // set the value count for outgoing batch value vectors
 for (VectorWrapper<?> v : outContainer) {
  v.getValueVector().setValueCount(recordCount);
 }
 return recordCount;
}
origin: dremio/dremio-oss

public void processPages(long recordsToReadInThisPass) throws IOException {
 reset();
 if(recordsToReadInThisPass>0) {
  do {
   determineSize(recordsToReadInThisPass, 0);
  } while (valuesReadInCurrentPass < recordsToReadInThisPass && pageReader.hasPage());
 }
 valueVec.setValueCount(valuesReadInCurrentPass);
}
origin: dremio/dremio-oss

@Override
protected void readRecords(int valuesToRead) {
 if (valuesToRead == 0) {
  return;
 }
 // TODO - validate that this works in all cases, it fixes a bug when reading from multiple pages into
 // a single vector
 dataReader.valuesReadInCurrentPass = 0;
 dataReader.readValues(valuesToRead);
 valuesReadInCurrentPass += valuesToRead;
 valueVec.setValueCount(repeatedGroupsReadInCurrentPass);
 valueVec.getDataVector().setValueCount(valuesReadInCurrentPass);
}
origin: dremio/dremio-oss

/**
 * Method is invoked when we have a straight aggregate (no group by expression) and our input is empty.
 * In this case we construct an outgoing batch with record count as 1. For the nullable vectors we don't set anything
 * as we want the output to be NULL. For the required vectors (only for count()) we set the value to be zero since
 * we don't zero out our buffers initially while allocating them.
 */
private void constructSpecialBatch() {
 outgoing.allocateNew();
 List<NamedExpression> exprs = config.getExprs();
 if(outgoing.getNumberOfColumns() != exprs.size()){
  throw new IllegalStateException();
 }
 int exprIndex = 0;
 for (final VectorWrapper<?> vw: outgoing) {
  final ValueVector vv = vw.getValueVector();
  if (!exprs.isEmpty() && isCount(exprs.get(exprIndex))) {
   ((BigIntVector) vv).setSafe(0, 0);
  }
  vv.setValueCount(SPECIAL_BATCH_COUNT);
  exprIndex++;
 }
 outgoing.setRecordCount(SPECIAL_BATCH_COUNT);
}
origin: dremio/dremio-oss

public static void evaluate(int recordCount, FunctionContext functionContext, VectorAccessible incoming, ValueVector outVV, LogicalExpression expr) {
 InitVisitor initVisitor = new InitVisitor(functionContext);
 EvalVisitor evalVisitor = new EvalVisitor(incoming, functionContext);
 expr.accept(initVisitor, incoming);
 for (int i = 0; i < recordCount; i++) {
  ValueHolder out = expr.accept(evalVisitor, i);
  TypeHelper.setValueSafe(outVV, i, out);
 }
 outVV.setValueCount(recordCount);
}
origin: dremio/dremio-oss

@Override
public int outputData() throws Exception {
 state.is(State.CAN_PRODUCE);
 final int records = incoming.getRecordCount();
 for(JsonConverter<?> converter : converters){
  converter.convert(records);
 }
 for(TransferPair transfer : transfers){
  transfer.transfer();
  transfer.getTo().setValueCount(records);
 }
 outgoing.setRecordCount(records);
 state = State.CAN_CONSUME;
 return records;
}
origin: dremio/dremio-oss

private static VectorContainer createBatch(int recordCount, ValueVector... vv) {
 VectorContainer container = new VectorContainer();
 if (recordCount != 0) {
  for (ValueVector v : vv) {
   v.setValueCount(recordCount);
  }
 }
 container.addCollection(asList(vv));
 container.setRecordCount(recordCount);
 container.buildSchema(SelectionVectorMode.NONE);
 return container;
}
origin: dremio/dremio-oss

@Override
public int next() {
 int recordCount = inner.next();
 if (mutator.isSchemaChanged()) {
  newSchema();
 }
 incoming.setAllCount(recordCount);
 if (DEBUG_PRINT) {
  FragmentHandle h = context.getFragmentHandle();
  outgoing.buildSchema();
  String op = String.format("CoercionReader:%d:%d:%d --> (%d), %s", h.getMajorFragmentId(), h.getMinorFragmentId(), context.getStats().getOperatorId(), recordCount, outgoing.getSchema());
  System.out.println(op);
  BatchPrinter.printBatch(mutator.getContainer());
 }
 if (projector != null) {
  projector.projectRecords(recordCount);
  for (final ValueVector v : allocationVectors) {
   v.setValueCount(recordCount);
  }
 }
 return recordCount;
}
origin: dremio/dremio-oss

 public int next(int desiredCount){
  final long termination = Math.min(startIndex + rowCount, index + desiredCount);
  final int recordsGenerated = (int) (termination - index);

//    System.out.println(String.format("[next] rowCount: %d, start: %d, termination: %d, records: %d", rowCount, index, termination, recordsGenerated));
  if(recordsGenerated < 1){
   return 0;
  }

  all.allocateNew();

  int vectorIndex = 0;
  for(long i = index; i < termination; i++, vectorIndex++){
   generateRecord(i, vectorIndex);
   for(AbstractRandomInt r : randoms){
    r.rowFinished();
   }
  }

  index += recordsGenerated;

  returned.setRecordCount(recordsGenerated);
  for(VectorWrapper<?> w : returned){
   w.getValueVector().setValueCount(recordsGenerated);
  }

  return recordsGenerated;
 }

origin: dremio/dremio-oss

@Override
public int outputData() {
 state.is(State.CAN_PRODUCE);
 if (!canCopy()) {
  consolidateIfNecessary();
  updateStats();
  return 0;
 }
 int copied = copier.copy(targetBatchSize);
 if (copied == 0) {
  state = State.DONE;
  return 0;
 }
 if (sortState == SortState.COPY_FROM_DISK) {
  // need to use the copierAllocator for the copy, because the copierAllocator is the one that reserves enough
  // memory to copy the data. This requires using an intermedate VectorContainer. Now, we need to transfer the
  // the output data to the output VectorContainer
  diskRuns.transferOut(output, copied);
 }
 for (VectorWrapper<?> w : output) {
  w.getValueVector().setValueCount(copied);
 }
 output.setRecordCount(copied);
 return copied;
}
origin: dremio/dremio-oss

@Override
public int outputData() {
 if(checkForStraightCopy && incoming.getRecordCount() == randomVector.getValueCount()){
  for(TransferPair tp : transferPairs){
   tp.transfer();
  }
  output.setRecordCount(incoming.getRecordCount());
  state = State.CAN_CONSUME;
  return incoming.getRecordCount();
 }
 int recordCount = incoming.getRecordCount() - this.copyOffset;
 int copiedRecords = copier.copyRecords(copyOffset, recordCount);
 if(copiedRecords < recordCount){
  copyOffset = copyOffset + copiedRecords;
 }else{
  copyOffset = 0;
  state = State.CAN_CONSUME;
 }
 if(copiedRecords > 0){
  for(VectorWrapper<?> v : output){
   v.getValueVector().setValueCount(copiedRecords);
  }
 }
 output.setRecordCount(copiedRecords);
 return copiedRecords;
}
org.apache.arrow.vectorValueVectorsetValueCount

Javadoc

Set number of values in the vector.

Popular methods of ValueVector

  • getField
    Get information about how this field is materialized.
  • getObject
    Get friendly type object from the vector.
  • isNull
    Check whether an element in the vector is null.
  • allocateNew
    Allocate new buffers. ValueVector implements logic to determine how much to allocate.
  • clear
    Release any owned ArrowBuf and reset the ValueVector to the initial state. If the vector has any chi
  • close
    Alternative to clear(). Allows use as an AutoCloseable in try-with-resources.
  • getValueCount
    Gets the number of values.
  • allocateNewSafe
    Allocates new buffers. ValueVector implements logic to determine how much to allocate.
  • getBufferSize
    Get the number of bytes used by this vector.
  • getBufferSizeFor
    Returns the number of bytes that is used by this vector if it holds the given number of values. The
  • getBuffers
    Return the underlying buffers associated with this vector. Note that this doesn't impact the referen
  • getMinorType
  • getBuffers,
  • getMinorType,
  • getNullCount,
  • getReader,
  • getTransferPair,
  • setInitialCapacity,
  • getAllocator,
  • getDataBuffer,
  • getValidityBuffer

Popular in Java

  • Making http requests using okhttp
  • findViewById (Activity)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • addToBackStack (FragmentTransaction)
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • Top 17 Plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now