stargate / data-api

JSON document API for Apache Cassandra (formerly known as JSON API)
https://stargate.io
Apache License 2.0
14 stars 16 forks source link

validate null values insertion for PK columns #1678

Closed Yuqi-Du closed 1 week ago

Yuqi-Du commented 2 weeks ago

{
    "insertMany": {
        "documents": [
            {
                "id": "11",
                "age": 1,
                "name": "haha"
            },
            {
                "id": null,
                "age": 1,
                "name": ""
            },
            {
                "id": "13",
                "age": 1,
                "name": "hah"
            }
        ],
        "options": {
            "ordered": true
        }
    }
}

{
    "status": {
        "insertedIds": [
            [
                "11"
            ]
        ],
        "primaryKeySchema": {
            "id": {
                "type": "text"
            }
        }
    },
    "errors": [
        {
            "message": "An unexpected server error occurred while processing the request. \n\nError Class: InvalidQueryException\nError Message: Invalid null value in condition for column id",
            "scope": "",
            "errorCode": "UNEXPECTED_SERVER_ERROR",
            "id": "e706d435-094a-4157-9d07-420b56617f57",
            "family": "SERVER",
            "title": "Unexpected server error"
        }
    ]
}
amorton commented 1 week ago

this may now be a dup / not needed #1691