In our team we started using the new INSERT with ON CONFLICT DO NOTHING clause which works in our cloud spanner instances. Whereas when we attempted to use it in our tests and local development we observed following error.
SQL Error [12]: UNIMPLEMENTED: com.google.api.gax.rpc.UnimplementedException: io.grpc.StatusRuntimeException: UNIMPLEMENTED: ON CONFLICT clause with empty conflict target in INSERT statement is not supported in Emulator
Looks like the ON CONFLICT clause is not supported in emulator.
Sample DB schema and INSERT DMLs
CREATE TABLE test ( id INT64 NOT NULL, created_on TIMESTAMP NOT NULL DEFAULT (CURRENT_TIMESTAMP())) PRIMARY KEY (id);
INSERT INTO test (id, created_on) VALUES (1, CURRENT_TIMESTAMP());
INSERT INTO test (id, created_on) VALUES (1, CURRENT_TIMESTAMP()) ON CONFLICT DO NOTHING;
Dialect - GoogleSQL
In our team we started using the new INSERT with ON CONFLICT DO NOTHING clause which works in our cloud spanner instances. Whereas when we attempted to use it in our tests and local development we observed following error.
SQL Error [12]: UNIMPLEMENTED: com.google.api.gax.rpc.UnimplementedException: io.grpc.StatusRuntimeException: UNIMPLEMENTED: ON CONFLICT clause with empty conflict target in INSERT statement is not supported in EmulatorLooks like the
ON CONFLICTclause is not supported in emulator.Sample DB schema and INSERT DMLs
Dialect - GoogleSQL