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

com.clickzetta.platform.arrow.writer.DoubleWriter 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.Float8Vector;

public class DoubleWriter extends ArrowFieldWriter {

  private static final double EMPTY_DOUBLE = 0.0d;
  private Float8Vector float8Vector;

  public DoubleWriter(Float8Vector float8Vector) {
    super(float8Vector);
    this.float8Vector = float8Vector;
  }

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

  @Override
  void setDefaultValue() {
    float8Vector.setSafe(count, EMPTY_DOUBLE);
  }

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy