pivotalguru/outsourcer — pull request #2 by 0x0FFF (2013-12-16 13:28:24+00:00)
Title: Exception with invalid number in Oracle

Fix for the error that is caused by Oracle table, which contains a cell with invalid number value. It causes exception on converting it to String, so I catch it and replace this string with "null"

java -classpath /usr/local/os/jar/Outsourcer.jar:/usr/local/os/jar/gpdb.jar:/usr/local/os/jar/sqljdbc4.jar:/usr/local/os/jar/ojdbc6.jar -Xms128M -Xmx256M -Djava.security.egd=file:///dev/urandom ExternalData ingos_dev 5432 1 "select * from ais.docline" > ~/docline.data
[oracle.sql.LnxLibThin.lnxnuc(LnxLibThin.java:6099), oracle.sql.NUMBER.toText(NUMBER.java:2796), oracle.jdbc.driver.NumberCommonAccessor.getString(NumberCommonAccessor.java:3142), oracle.jdbc.driver.T4CNumberAccessor.getString(T4CNumberAccessor.java:85), oracle.jdbc.driver.OracleResultSetImpl.getString(OracleResultSetImpl.java:1297), CommonDB.outputData(CommonDB.java:566), ExternalData.executeExt(ExternalData.java:247), ExternalData.main(ExternalData.java:79)]
Column 10
Object 1000000
Partial output: 7486116|595316|62009816|15857|null|39|01|null|null
Exception in thread "main" java.lang.ClassCastException: java.math.BigDecimal cannot be cast to java.lang.String
at CommonDB.outputData(CommonDB.java:575)
at ExternalData.executeExt(ExternalData.java:247)
at ExternalData.main(ExternalData.java:79)