

package org.apache.flink.table.runtime.arrow.vectors;

import org.apache.flink.annotation.Internal;
import org.apache.flink.table.data.vector.ByteColumnVector;
import org.apache.flink.util.Preconditions;

import org.apache.arrow.vector.TinyIntVector;

/**
 * Arrow column vector for TinyInt.
 */
@Internal
public final class ArrowTinyIntColumnVector implements ByteColumnVector {

	private final TinyIntVector tinyIntVector;

	public ArrowTinyIntColumnVector(TinyIntVector tinyIntVector) {
		this.tinyIntVector = Preconditions.checkNotNull(tinyIntVector);
	}

	@Override
	public byte getByte(int i) {
		return tinyIntVector.get(i);
	}

	@Override
	public boolean isNullAt(int i) {
		return tinyIntVector.isNull(i);
	}
}
