# "Existing column \[id\] type \[uuid\] mismatch with inferred type \[list\<text\>\]" -- Is that fixable?

**URL:** <https://discuss.elastic.co/t/existing-column-id-type-uuid-mismatch-with-inferred-type-list-text-is-that-fixable/160279>\
**Category:** Elasticsearch\
**Created:** [December 11, 2018, 3:28am UTC](https://discuss.elastic.co/t/existing-column-id-type-uuid-mismatch-with-inferred-type-list-text-is-that-fixable/160279 "2018-12-11T03:28:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![AlexisWilke](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alexiswilke/32/38600_2.png) [@AlexisWilke](https://discuss.elastic.co/u/AlexisWilke)\
**Post date:** [December 11, 2018, 3:28am UTC](https://discuss.elastic.co/t/existing-column-id-type-uuid-mismatch-with-inferred-type-list-text-is-that-fixable/160279/1 "2018-12-11T03:28:24Z")

</div>

I'm trying to create an Elasticsearch join between two tables using a UUID field.

My main table looks something like this:

```
CREATE TABLE main_table (
    id UUID PRIMARY KEY,
    ...other fields...
);

```

The child table includes a reference back to the main table:

```
CREATE TABLE child_table (
    child_id UUID PRIMARY KEY,
    main_id UUID,
    ...other fields...
);

```

I use Elassandra to get the tables and indexes built, although here I show the `curl -XPUT ...` commands as I can reproduce the problem that way too (so the problem is not in Elassandra or `express-cassandra`):

```
curl -XPUT \
    -H 'Content-Type: application/json' \
    "http://127.0.0.1:9200/my_workspace_main_table/?pretty" \
    -d '{
        "settings": {
            "keyspace": "'my_workspace'",
            "index": {
                "number_of_shards": 1
            }
       },
        "index": {
            "number_of_shards": 1
        }
    }'

# NOTE: In my script I sleep for a little while here to make sure
# the index is built or I get a 404 Index Not Found error

```

Now that we have an index, we can build the mapping with another `PUT` like so:

```
curl -XPUT \
    --max-time 3600 \
    -H 'Content-Type: application/json' \
    "http://127.0.0.1:9200/my_workspace_main_table/_mapping/main_table/?pretty" \
    -d '{
        "properties": {
            "id": {
                "type": "join",
                "relations": {
                    "question": "parent_id"
                },
                "eager_global_ordinals": true
            }
        }
    }'

```

Here I set the type to `"join"` which means I can't specify `"cql_collection": "singleton"` for my column. _Because of that,_ I get an error:

> ```
> {
> "error" : {
> "root_cause" : [
> {
> "type" : "i_o_exception",
> "reason" : "Existing column [id] type [uuid] mismatch with inferred type [list<text>]"
> }
> ],
> "type" : "i_o_exception",
> "reason" : "Existing column [id] type [uuid] mismatch with inferred type [list<text>]",
> "caused_by" : {
> "type" : "i_o_exception",
> "reason" : "Existing column [id] type [uuid] mismatch with inferred type [list<text>]"
> }
> },
> "status" : 500
> }
> 
> ```

Is there a way to bypass this error? I don't want to have to use a `list<text>` for my UUIDs.

Note that I tested and changing my column type to `list<text>` does the job and when I do that I get the following mapping:

```
{
  "my_workspace_t16" : {
    "mappings" : {
      "my_table" : {
        "properties" : {
          "id" : {
            "type" : "join",
            "eager_global_ordinals" : true,
            "relations" : {
              "question" : "parent_id"
            }
          }
        }
      }
    }
  }
}

```

If you know the reason behind this _weird inferred type_ (if you ask me,) I would be delighted to hear about. A link to a page that explains that choice would be wonderful.

* * *

I also tested with the `keyword` type and the following works as expected, but then I don't get a join, do I?

```
curl -XPUT \
    --max-time 3600 \
    -H 'Content-Type: application/json' \
    "http://127.0.0.1:9200/my_workspace_main_table/_mapping/main_table/?pretty" \
    -d '{
        "properties": {
            "id": {
                "type": "keyword",
                "cql_collection": "singleton"
            }
        }
    }'

```

---

<div class="post-metadata">

**Author:** ![AlexisWilke](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alexiswilke/32/38600_2.png) [@AlexisWilke](https://discuss.elastic.co/u/AlexisWilke)\
**Post date:** [December 11, 2018, 3:40am UTC](https://discuss.elastic.co/t/existing-column-id-type-uuid-mismatch-with-inferred-type-list-text-is-that-fixable/160279/2 "2018-12-11T03:40:23Z")

</div>

Some version information:

2018-12-03 18:17:18,555 INFO [main] StorageService.java:618 initServer Cassandra version: 3.11.3  
2018-12-03 18:17:18,556 INFO [main] StorageService.java:619 initServer Thrift API version: 20.1.0  
2018-12-03 18:17:18,561 INFO [main] StorageService.java:620 initServer CQL supported versions: 3.4.4 (default: 3.4.4)  
2018-12-03 18:17:18,562 INFO [main] StorageService.java:622 initServer Native protocol supported versions: 3/v3, 4/v4, 5/v5-beta (default: 4/v4)  
elassandra-6.2.3.7.tar.gz

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [January 8, 2019, 3:40am UTC](https://discuss.elastic.co/t/existing-column-id-type-uuid-mismatch-with-inferred-type-list-text-is-that-fixable/160279/3 "2019-01-08T03:40:28Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
