diff --git a/java/flight/flight-sql/src/test/java/org/apache/arrow/flight/TestFlightSql.java b/java/flight/flight-sql/src/test/java/org/apache/arrow/flight/TestFlightSql.java index 8001cf2c1e549..115f85f0d419b 100644 --- a/java/flight/flight-sql/src/test/java/org/apache/arrow/flight/TestFlightSql.java +++ b/java/flight/flight-sql/src/test/java/org/apache/arrow/flight/TestFlightSql.java @@ -785,8 +785,12 @@ List> getResults(FlightStream stream) { } } else if (fieldVector instanceof IntVector) { for (int rowIndex = 0; rowIndex < rowCount; rowIndex++) { - Object data = fieldVector.getObject(rowIndex); - results.get(rowIndex).add(isNull(data) ? null : Objects.toString(data)); + try { + results.get(rowIndex).add(String.valueOf(((IntVector) fieldVector).get(rowIndex))); + } catch (IllegalStateException e) { + System.out.println(("Failed at index " + rowIndex)); + throw e; + } } } else if (fieldVector instanceof VarBinaryVector) { final VarBinaryVector varbinaryVector = (VarBinaryVector) fieldVector;