8000 AutoIncrement not working as expected · Issue #159 · vitrivr/cottontaildb · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
AutoIncrement not working as expected #159
Open
@lucaro

Description

@lucaro

When trying to insert into an entity with an auto-increment column that has a unique index, the insert fails due to duplicate keys.
Here is a minimal example to reproduce the issue on the most recent release 0.16.5:

@JvmStatic
    fun main(args: Array<String>) {


        val channel = ManagedChannelBuilder.forAddress("localhost", 1865).usePlaintext().build()

        val client = SimpleClient(channel)


        client.create(CreateSchema("test").ifNotExists())

        client.create(
            CreateEntity("test.test_entity")
                .column(Name.ColumnName.create("id"), Types.Long, autoIncrement = true)
                .column(Name.ColumnName.create("value"), Types.String)
                .ifNotExists()
        )


        client.create(
            CreateIndex(
                Name.EntityName.create("test", "test_entity"),
                CottontailGrpc.IndexType.BTREE_UQ
            ).column("id")
        )

        val batchInsert = BatchInsert("test.test_entity").columns("value")

        batchInsert.any("first entry")
        batchInsert.any("second entry")
        batchInsert.any("third entry")

        client.insert(batchInsert)

        client.close()


    }
Exception in thread "main" io.grpc.StatusRuntimeException: INVALID_ARGUMENT: [112, 6cd2516c-f613-4fac-96fe-d772fcb843e5] Execution of Insert query failed: Mapping of LongValue(value=1) to tuple 1 could be added to UniqueHashIndex, because value must be unique.
	at io.grpc.stub.ClientCalls.toStatusRuntimeException(ClientCalls.java:268)
	at io.grpc.stub.ClientCalls.getUnchecked(ClientCalls.java:249)
	at io.grpc.stub.ClientCalls.blockingUnaryCall(ClientCalls.java:167)
	at org.vitrivr.cottontail.grpc.DMLGrpc$DMLBlockingStub.insertBatch(DMLGrpc.java:355)
	at org.vitrivr.cottontail.client.SimpleClient.insert$lambda$14$lambda$13(SimpleClient.kt:180)
	at io.grpc.Context.call(Context.java:551)
	at org.vitrivr.cottontail.client.SimpleClient.insert$lambda$14(SimpleClient.kt:178)
	at io.grpc.Context.call(Context.java:551)
	at org.vitrivr.cottontail.client.SimpleClient.insert(SimpleClient.kt:176)
	at org.vitrivr.cottontail.client.SimpleClient.insert(SimpleClient.kt:190)


Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0