All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.clickzetta.platform.arrow.writer.IntegerWriter Maven / Gradle / Ivy

There is a newer version: 2.0.0
Show newest version
package com.clickzetta.platform.arrow.writer;

import com.clickzetta.platform.catalyst.data.DataGetters;
import org.apache.arrow.vector.IntVector;

public class IntegerWriter extends ArrowFieldWriter {

  private static final int EMPTY_INT = 0;
  private IntVector intVector;

  public IntegerWriter(IntVector intVector) {
    super(intVector);
    this.intVector = intVector;
  }

  @Override
  public void setNull() {
    intVector.setNull(count);
  }

  @Override
  void setDefaultValue() {
    intVector.setSafe(count, EMPTY_INT);
  }

  @Override
  void setValue(DataGetters row, int ordinal) {
    intVector.setSafe(count, row.getInt(ordinal));
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy