Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import org.apache.arrow.vector.VectorSchemaRoot;
import org.apache.arrow.vector.types.pojo.ArrowType;
import org.apache.calcite.avatica.remote.TypedValue;
import org.checkerframework.checker.nullness.qual.Nullable;

/**
* Convert Avatica PreparedStatement parameters from a list of TypedValue to Arrow and bind them to
Expand Down Expand Up @@ -108,9 +109,9 @@ public void bind(List<TypedValue> typedValues, int index) {
* @param typedValue TypedValue to bind to the vector.
* @param index Vector index to bind the value at.
*/
private void bind(FieldVector vector, TypedValue typedValue, int index) {
private void bind(FieldVector vector, @Nullable TypedValue typedValue, int index) {
try {
if (typedValue.value == null) {
if (typedValue == null || typedValue.value == null) {
if (vector.getField().isNullable()) {
vector.setNull(index);
} else {
Expand All @@ -127,7 +128,7 @@ private void bind(FieldVector vector, TypedValue typedValue, int index) {
throw new UnsupportedOperationException(
String.format(
"Binding value of type %s is not yet supported for expected Arrow type %s",
typedValue.type, vector.getField().getType()));
typedValue == null ? "null" : typedValue.type, vector.getField().getType()));
}
}

Expand Down