2
respostas

ERRO PENTAHO

Estou tendo esse problema de encoding ao realizar uma consulta a um banco de dados postgre

2021/06/05 13:19:14 - RepositoriesMeta - Reading repositories XML file: C:\Users\adriano.santos\.kettle\repositories.xml
2021/06/05 13:19:25 - RepositoriesMeta - Reading repositories XML file: C:\Users\adriano.santos\.kettle\repositories.xml
2021/06/05 13:19:26 - Spoon - Connected to metastore : repo_bi_cr, added to delegating metastore
2021/06/05 13:19:26 - RepositoriesMeta - Reading repositories XML file: C:\Users\adriano.santos\.kettle\repositories.xml
2021/06/05 13:20:57 - /carga_stage/carga_stage_ura - Expedindo in�cio para transforma��o [/carga_stage/carga_stage_ura]
2021/06/05 13:21:00 - Table input.0 - ERROR (version 9.1.0.0-324, build 9.1.0.0-324 from 2020-09-07 05.09.05 by buildguy) : Erro inesperado
2021/06/05 13:21:00 - Table input.0 - ERROR (version 9.1.0.0-324, build 9.1.0.0-324 from 2020-09-07 05.09.05 by buildguy) : org.pentaho.di.core.exception.KettleDatabaseException: 
2021/06/05 13:21:00 - Table input.0 - An error occurred executing SQL: 
2021/06/05 13:21:00 - Table input.0 - SELECT * FROM ingenium.trunk
2021/06/05 13:21:00 - Table input.0 - ERROR: invalid byte sequence for encoding "UTF8": 0xf4 0x6e 0x69 0x63
2021/06/05 13:21:00 - Table input.0 - 
2021/06/05 13:21:00 - Table input.0 -     at org.pentaho.di.core.database.Database.openQuery(Database.java:1772)
2021/06/05 13:21:00 - Table input.0 -     at org.pentaho.di.trans.steps.tableinput.TableInput.doQuery(TableInput.java:236)
2021/06/05 13:21:00 - Table input.0 -     at org.pentaho.di.trans.steps.tableinput.TableInput.processRow(TableInput.java:140)
2021/06/05 13:21:00 - Table input.0 -     at org.pentaho.di.trans.step.RunThread.run(RunThread.java:62)
2021/06/05 13:21:00 - Table input.0 -     at java.lang.Thread.run(Unknown Source)
2021/06/05 13:21:00 - Table input.0 - Caused by: org.postgresql.util.PSQLException: ERROR: invalid byte sequence for encoding "UTF8": 0xf4 0x6e 0x69 0x63
2021/06/05 13:21:00 - Table input.0 -     at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2440)
2021/06/05 13:21:00 - Table input.0 -     at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2183)
2021/06/05 13:21:00 - Table input.0 -     at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:308)
2021/06/05 13:21:00 - Table input.0 -     at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441)
2021/06/05 13:21:00 - Table input.0 -     at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365)
2021/06/05 13:21:00 - Table input.0 -     at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:307)
2021/06/05 13:21:00 - Table input.0 -     at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:293)
2021/06/05 13:21:00 - Table input.0 -     at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:270)
2021/06/05 13:21:00 - Table input.0 -     at org.postgresql.jdbc.PgStatement.executeQuery(PgStatement.java:224)
2021/06/05 13:21:00 - Table input.0 -     at org.pentaho.di.core.database.Database.openQuery(Database.java:1761)
2021/06/05 13:21:00 - Table input.0 -     ... 4 more
2021/06/05 13:21:00 - Table input.0 - Finished reading query, closing connection.
2021/06/05 13:21:01 - Table input.0 - Finished processing (I=0, O=0, R=0, W=0, U=0, E=1)
2021/06/05 13:21:01 - /carga_stage/carga_stage_ura - Transforma��o detectada 
2021/06/05 13:21:01 - /carga_stage/carga_stage_ura - Transforma��o est� matando os outros steps!
2021/06/05 14:55:58 - /carga_stage/carga_stage_ura - Expedindo in�cio para transforma��o [/carga_stage/carga_stage_ura]
2021/06/05 14:56:03 - Table input.0 - ERROR (version 9.1.0.0-324, build 9.1.0.0-324 from 2020-09-07 05.09.05 by buildguy) : Erro inesperado
2021/06/05 14:56:03 - Table input.0 - ERROR (version 9.1.0.0-324, build 9.1.0.0-324 from 2020-09-07 05.09.05 by buildguy) : org.pentaho.di.core.exception.KettleDatabaseException: 
2 respostas

Segue abaixo estrutura do banco.

-- Database: data_ims

-- DROP DATABASE data_ims;

CREATE DATABASE data_ims
    WITH 
    OWNER = postgres
    ENCODING = 'SQL_ASCII'
    LC_COLLATE = 'C'
    LC_CTYPE = 'C'
    TABLESPACE = pg_default
    CONNECTION LIMIT = -1;

GRANT ALL ON DATABASE data_ims TO postgres;

GRANT TEMPORARY, CONNECT ON DATABASE data_ims TO PUBLIC;

Oii Robson, tudo bem?

Qual a finalidade dessa consulta no Pentaho? Alimentar alguma tabela, ou algo do tipo?

Esse erro pode ser por a tabela ingenium.trunk ter registros com caracteres especiais tipo cedilha, acentuação e a tabela data_ims não aceita esses caracteres especiais.

Tem duas soluções:

  • Remover os caracteres especiais dos registros

ou

  • Alterar o encoding para UTF-8

Me avise qualquer coisa, beleza? :)

Quer mergulhar em tecnologia e aprendizagem?

Receba a newsletter que o nosso CEO escreve pessoalmente, com insights do mercado de trabalho, ciência e desenvolvimento de software