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

com.clickzetta.platform.arrow.writer.DateWriter 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.DateDayVector;

public class DateWriter extends ArrowFieldWriter {

  private static final byte EMPTY_INT = 0;
  private DateDayVector dateDayVector;

  public DateWriter(DateDayVector dateDayVector) {
    super(dateDayVector);
    this.dateDayVector = dateDayVector;
  }

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

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy