2017-08-16 11 views
0

こんにちは、私はに新規です。pentaho kettle version 7.1mysql jdbc driverのバージョンは5.1.43です。私は別のデータベースに2つの同じテーブルを持っています。は、本番でホストされている最初のデータベースであり、db2は開発中にホストされた別のデータベースです。 db1db2の両方にdashboard_userという同じテーブルがあります。表dashboard_userは、autoincrementの主キーidを持っています。しかし、問題は、私は開発中の削除既存のデータなしに生産から開発に値をコピーしようとしたとき、それは以下のように返している:Pentahoエラー:プライマリ以外のキーの重複エントリ

017/08/16 15:13:02 - Table output.0 - Connected to database [localhost] (commit=1000) 2017/08/16 15:13:02 - Table output.0 - ERROR (version 7.1.0.0-12, build 1 from 2017-05-16 17.18.02 by buildguy) : Because of an error, this step can't continue: 2017/08/16 15:13:02 - Table output.0 - ERROR (version 7.1.0.0-12, build 1 from 2017-05-16 17.18.02 by buildguy) : org.pentaho.di.core.exception.KettleException: 2017/08/16 15:13:02 - Table output.0 - Error inserting row into table [dashboard_domains] with values: [sonar.id], [2016/07/17 07:27:31.000000000], [2017/07/25 08:08:26.000000000] 2017/08/16 15:13:02 - Table output.0 - 2017/08/16 15:13:02 - Table output.0 - Error inserting/updating row 2017/08/16 15:13:02 - Table output.0 - Duplicate entry 'sonar.id' for key 'index_dashboard_domains_on_domain' 2017/08/16 15:13:02 - Table output.0 - 2017/08/16 15:13:02 - Table output.0 - 2017/08/16 15:13:02 - Table output.0 - at org.pentaho.di.trans.steps.tableoutput.TableOutput.writeToTable(TableOutput.java:385) 2017/08/16 15:13:02 - Table output.0 - at org.pentaho.di.trans.steps.tableoutput.TableOutput.processRow(TableOutput.java:125) 2017/08/16 15:13:02 - Table output.0 - at org.pentaho.di.trans.step.RunThread.run(RunThread.java:62) 2017/08/16 15:13:02 - Table output.0 - at java.lang.Thread.run(Thread.java:748) 2017/08/16 15:13:02 - Table output.0 - Caused by: org.pentaho.di.core.exception.KettleDatabaseException: 2017/08/16 15:13:02 - Table output.0 - Error inserting/updating row 2017/08/16 15:13:02 - Table output.0 - Duplicate entry 'sonar.id' for key 'index_dashboard_domains_on_domain' 2017/08/16 15:13:02 - Table output.0 - 2017/08/16 15:13:02 - Table output.0 - at org.pentaho.di.core.database.Database.insertRow(Database.java:1321) 2017/08/16 15:13:02 - Table output.0 - at org.pentaho.di.trans.steps.tableoutput.TableOutput.writeToTable(TableOutput.java:262) 2017/08/16 15:13:02 - Table output.0 - ... 3 more 2017/08/16 15:13:02 - Table output.0 - Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry 'sonar.id' for key 'index_dashboard_domains_on_domain' 2017/08/16 15:13:02 - Table output.0 - at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 2017/08/16 15:13:02 - Table output.0 - at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) 2017/08/16 15:13:02 - Table output.0 - at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) 2017/08/16 15:13:02 - Table output.0 - at java.lang.reflect.Constructor.newInstance(Constructor.java:423) 2017/08/16 15:13:02 - Table output.0 - at com.mysql.jdbc.Util.handleNewInstance(Util.java:425) 2017/08/16 15:13:02 - Table output.0 - at com.mysql.jdbc.Util.getInstance(Util.java:408) 2017/08/16 15:13:02 - Table output.0 - at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:935) 2017/08/16 15:13:02 - Table output.0 - at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3973) 2017/08/16 15:13:02 - Table output.0 - at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3909) 2017/08/16 15:13:02 - Table output.0 - at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2527) 2017/08/16 15:13:02 - Table output.0 - at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2680) 2017/08/16 15:13:02 - Table output.0 - at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2494) 2017/08/16 15:13:02 - Table output.0 - at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1858) 2017/08/16 15:13:02 - Table output.0 - at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2079) 2017/08/16 15:13:02 - Table output.0 - at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2013) 2017/08/16 15:13:02 - Table output.0 - at com.mysql.jdbc.PreparedStatement.executeLargeUpdate(PreparedStatement.java:5104) 2017/08/16 15:13:02 - Table output.0 - at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1998) 2017/08/16 15:13:02 - Table output.0 - at org.pentaho.di.core.database.Database.insertRow(Database.java:1288) 2017/08/16 15:13:02 - Table output.0 - ... 4 more 2017/08/16 15:13:02 - Table output.0 - Finished processing (I=0, O=0, R=1, W=0, U=0, E=1)

それは言う:

Error inserting/updating row 2017/08/16 15:13:02 - Table output.0 - Duplicate entry 'sonar.id' for key 'index_dashboard_domains_on_domain' 2017/08/16 15:13:02 - Table output.0 - 2017/08/16 15:13:02 - Table output.0 - 2017/08/16 15:13:02 - Table output.0 - at org.pentaho.di.trans.steps.tableoutput.TableOutput.writeToTable(TableOutput.java:385)

sonar.idは、ユーザ名ではなく、主キーでありますなぜ私はデータを転送できないのだろうと思っていたのですか?重複するキーを示すエラーを返すか?

答えて

0

それはあなたに伝えるものを正確にしようとします:重複するIDを持つキーを挿入してください。

最初の解決策は、レコードを再度挿入する前に出力テーブルを削除(切り捨て)することです。

2番目の解決策は、エラーハンドラを使用してOutput tableを使用することです。Dummyステップを置き、ホップ/矢印を定義するときにエラー処理を選択します。この手順では、重複を含むすべてのエラーを受け取ります。

第3の解決方法は、増分ロードをCRUDで行うことです。このステップの名前はJoins/Merge Row (diff)です。参照する(既存の)データと新しい受信データ、および比較するキーを指定します。ケトルは次に、新しいデータだけを除外することができる「新規」、「削除済み」、「同一」または「更新済み」を含む新しいフィールドを作成します。

enter image description here

関連する問題