Hbaseにデータを挿入するために、フェニックスコンバインとjdbcTemplateを使用しています。
- Phoenix4.7.0
- Hベース1.1.2
テーブルの列(id)の1つは、シーケンスで単調に生成されます。通常、「jdbcTemplate.execute(sql)」メソッドを使用してデータを挿入します。例: "upsert into table(row id) values( "row"," NEXT VALUE FOR table.id_sequence" )" 2 番目の列 (id) はシーケンスで自動的に生成されます。それは問題ありません。しかし、「jdbcTemplate.batchUpdate」メソッドを使用すると、batchInsert と同じ sql を使用すると、何か問題があります。
Caused by: org.apache.phoenix.exception.BatchUpdateExecution: ERROR 1106 (XCL06): Exception while executing batch.
at org.apache.phoenix.jdbc.PhoenixStatement.executeBatch(PhoenixStatement.java:1226)
at org.apache.commons.dbcp.DelegatingStatement.executeBatch(DelegatingStatement.java:297)
at org.apache.commons.dbcp.DelegatingStatement.executeBatch(DelegatingStatement.java:297)
at org.springframework.jdbc.core.JdbcTemplate$4.doInPreparedStatement(JdbcTemplate.java:905)
at org.springframework.jdbc.core.JdbcTemplate$4.doInPreparedStatement(JdbcTemplate.java:890)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:589)
... 45 more
Caused by: org.apache.phoenix.schema.TypeMismatchException: ERROR 203 (22005): Type mismatch. BIGINT and VARCHAR for NEXT VALUE FOR AQMDATA_ALL.id_sequence
どうすれば修正できますか?