stargate / data-api

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

addIndex seems to fail on names with uppercase (missing double quotes)? #1404

Open vkarpov15 opened 1 week ago

vkarpov15 commented 1 week ago

I created a table with the following command:

{
  "createTable": {
    "name": "reviews",
    "definition": {
      "primaryKey": "_id",
      "columns": {
        "_id": {
          "type": "text"
        },
        "rating": {
          "type": "int"
        },
        "text": {
          "type": "text"
        },
        "userId": {
          "type": "text"
        },
        "vehicleId": {
          "type": "text"
        },
        "createdAt": {
          "type": "decimal"
        },
        "updatedAt": {
          "type": "decimal"
        }
      }
    }
  }
}

Table looks like the following in cqlsh:

image

Running addIndex on vehicleId property as follows:

{
  "addIndex": {
    "column": "vehicleId",
    "indexName": "vehicleId"
  }
}

Gives me an error:

Error: Command "addIndex" failed with the following errors: [{"message":"Undefined column name vehicleid in table demo.reviews","errorCode":"INVALID_QUERY"}]

Likely need to double quote column names in addIndex?

vkarpov15 commented 20 hours ago

You can see an example failure here: https://github.com/stargate/stargate-mongoose-sample-apps/actions/runs/10944064429/job/30385029328?pr=397

image