com.clickzetta.platform.arrow.writer.BinaryWriter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of clickzetta-java Show documentation
Show all versions of clickzetta-java Show documentation
The java SDK for clickzetta's Lakehouse
package com.clickzetta.platform.arrow.writer;
import com.clickzetta.platform.catalyst.data.DataGetters;
import org.apache.arrow.vector.VarBinaryVector;
public class BinaryWriter extends ArrowFieldWriter {
private static final byte[] EMPTY_BINARY = new byte[0];
private VarBinaryVector varBinaryVector;
public BinaryWriter(VarBinaryVector varBinaryVector) {
super(varBinaryVector);
this.varBinaryVector = varBinaryVector;
}
@Override
public void setNull() {
varBinaryVector.setNull(count);
}
@Override
void setDefaultValue() {
varBinaryVector.setSafe(count, EMPTY_BINARY, 0, EMPTY_BINARY.length);
}
@Override
void setValue(DataGetters row, int ordinal) {
byte[] bytes = row.getBinary(ordinal);
varBinaryVector.setSafe(count, bytes, 0, bytes.length);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy