src/main/java/org/embulk/input/jdbc/getter/ColumnGetterFactory.java in embulk-input-jdbc-0.7.2 vs src/main/java/org/embulk/input/jdbc/getter/ColumnGetterFactory.java in embulk-input-jdbc-0.7.3
- old
+ new
@@ -12,10 +12,12 @@
import org.embulk.spi.time.TimestampFormatter;
import org.embulk.spi.type.TimestampType;
import org.embulk.spi.type.Type;
import org.joda.time.DateTimeZone;
+import static java.util.Locale.ENGLISH;
+
public class ColumnGetterFactory
{
protected final PageBuilder to;
private final DateTimeZone defaultTimeZone;
private final Map<Integer, String> jdbcTypes = getAllJDBCTypes();
@@ -56,11 +58,12 @@
case "timestamp":
return new TimestampColumnGetter(to, toType, newTimestampFormatter(option, DateColumnGetter.DEFAULT_FORMAT));
case "decimal":
return new BigDecimalColumnGetter(to, toType);
default:
- throw new ConfigException(String.format("Unknown value_type '%s' for column '%s'", option.getValueType(), column.getName()));
+ throw new ConfigException(String.format(ENGLISH,
+ "Unknown value_type '%s' for column '%s'", option.getValueType(), column.getName()));
}
}
protected Map<Integer,String> getAllJDBCTypes() {
Map<Integer,String> map = new HashMap<Integer, String>();
@@ -183,9 +186,10 @@
}
private static UnsupportedOperationException unsupportedOperationException(JdbcColumn column)
{
throw new UnsupportedOperationException(
- String.format("Unsupported type %s (sqlType=%d) of '%s' column. Please exclude the column from 'select:' option.",
- column.getTypeName(), column.getSqlType(), column.getName()));
+ String.format(ENGLISH,
+ "Unsupported type %s (sqlType=%d) of '%s' column. Please add '%s: {type: string}' to 'column_options: {...}' option to convert the values to strings, or exclude the column from 'select:' option",
+ column.getTypeName(), column.getSqlType(), column.getName(), column.getName()));
}
}