Skip to content

Emulator not supporting INSERT with ON CONFLICT DO NOTHING clause #358

Description

@rssawhney

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions