gflewis / sndml3

ServiceNow Data Mart Loader: an application to load SQL databases from ServiceNow
MIT License
30 stars 19 forks source link

PostrgreSQL Error: invalid byte sequence for encoding "UTF8": 0x00 #9

Closed gflewis closed 5 years ago

gflewis commented 5 years ago
Exception in thread "main" org.postgresql.util.PSQLException: ERROR: invalid byte sequence for encoding "UTF8": 0x00
    at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2422)
    at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2167)
    at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:306)
    at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441)
    at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365)
    at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:155)
    at org.postgresql.jdbc.PgPreparedStatement.executeUpdate(PgPreparedStatement.java:132)
    at servicenow.datamart.DatabaseUpdateStatement.update(DatabaseUpdateStatement.java:38)
    at servicenow.datamart.DatabaseUpdateWriter.writeRecord(DatabaseUpdateWriter.java:29)
    at servicenow.datamart.DatabaseTableWriter.processRecords(DatabaseTableWriter.java:47)
    at servicenow.api.RestTableReader.call(RestTableReader.java:71)
    at servicenow.api.RestTableReader.call(RestTableReader.java:6)
    at servicenow.api.DatePartitionedTableReader.call(DatePartitionedTableReader.java:142)
    at servicenow.api.DatePartitionedTableReader.call(DatePartitionedTableReader.java:15)
    at servicenow.datamart.LoaderJob.call(LoaderJob.java:172)
    at servicenow.datamart.Loader.loadTables(Loader.java:95)
    at servicenow.datamart.Loader.main(Loader.java:60)
gflewis commented 5 years ago

Need to strip null characters from value when using PostgreSQL value.replaceAll("\u0000", "")

gflewis commented 5 years ago

Patched in 3.0.3