Skip to content
Merged
Show file tree
Hide file tree
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 @@ -24,7 +24,6 @@
import org.apache.arrow.util.AutoCloseables;
import org.apache.arrow.vector.ValueVector;
import org.apache.arrow.vector.VectorSchemaRoot;
import org.apache.arrow.vector.types.pojo.ArrowType;

/** Composite consumer which hold all consumers. It manages the consume and cleanup process. */
public class CompositeJdbcConsumer implements JdbcConsumer {
Expand All @@ -46,9 +45,9 @@ public void consume(ResultSet rs) throws SQLException, IOException {
BaseConsumer consumer = (BaseConsumer) consumers[i];
JdbcFieldInfo fieldInfo =
new JdbcFieldInfo(rs.getMetaData(), consumer.columnIndexInResultSet);
ArrowType arrowType = consumer.vector.getMinorType().getType();

throw new JdbcConsumerException(
"Exception while consuming JDBC value", e, fieldInfo, arrowType);
"Exception while consuming JDBC value", e, fieldInfo, consumer.vector.getField());
} else {
throw e;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,33 +17,33 @@
package org.apache.arrow.adapter.jdbc.consumer.exceptions;

import org.apache.arrow.adapter.jdbc.JdbcFieldInfo;
import org.apache.arrow.vector.types.pojo.ArrowType;
import org.apache.arrow.vector.types.pojo.Field;

/**
* Exception while consuming JDBC data. This exception stores the JdbcFieldInfo for the column and
* the ArrowType for the corresponding vector for easier debugging.
*/
public class JdbcConsumerException extends RuntimeException {
final JdbcFieldInfo fieldInfo;
final ArrowType arrowType;
final Field field;

/**
* Construct JdbcConsumerException with all fields.
*
* @param message error message
* @param cause original exception
* @param fieldInfo JdbcFieldInfo for the column
* @param arrowType ArrowType for the corresponding vector
* @param field ArrowType for the corresponding vector
*/
public JdbcConsumerException(
String message, Throwable cause, JdbcFieldInfo fieldInfo, ArrowType arrowType) {
String message, Throwable cause, JdbcFieldInfo fieldInfo, Field field) {
super(message, cause);
this.fieldInfo = fieldInfo;
this.arrowType = arrowType;
this.field = field;
}

public ArrowType getArrowType() {
return this.arrowType;
public Field getField() {
return this.field;
}

public JdbcFieldInfo getFieldInfo() {
Expand Down
Loading