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

com.clickzetta.platform.arrow.writer.FloatWriter 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.Float4Vector;

public class FloatWriter extends ArrowFieldWriter {

  private static final float EMPTY_FLOAT = 0.0f;
  private Float4Vector float4Vector;

  public FloatWriter(Float4Vector float4Vector) {
    super(float4Vector);
    this.float4Vector = float4Vector;
  }

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

  @Override
  void setDefaultValue() {
    float4Vector.setSafe(count, EMPTY_FLOAT);
  }

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy