Add context on data type transform failure
Bubbles up the column name on failure when generating segments with invalid schema.
@@ -80,6 +80,7 @@ public class DataTypeTransformer implements RecordTransformer {
public GenericRow transform(GenericRow record) {
for (Map.Entry<String, PinotDataType> entry : _dataTypes.entrySet()) {
String column = entry.getKey();
+ try {
Object value = record.getValue(column);
if (value == null) {
continue;
@@ -113,6 +114,9 @@ public class DataTypeTransformer implements RecordTransformer {
}
record.putValue(column, value);
+ } catch (Exception e) {
+ throw new RuntimeException("Caught exception while transforming data type for column: " + column, e);
+ }
}
return record;
}
