Skip to content

SQL: Unknown index verification exception when index does not contain any mappings #52865

Closed
@tobio

Description

@tobio

Elasticsearch version (bin/elasticsearch --version): 7.6.0 on ESS

Description of the problem including expected versus actual behavior:

Steps to reproduce:

Please include a minimal but complete recreation of the problem, including
(e.g.) index creation, mappings, settings, query etc. The easier you make for
us to reproduce it, the more likely that somebody will take the time to look at it.

  1. Create a new index, only supplying index settings
  2. Execute a SQL query against the index

Expected:
An unknown column verification exception, or a specific exception for this edge-case.

Actual:
An Unknown index verification exception. This is misleading, making debugging for the user more difficult.

{
        "type" : "verification_exception",
        "reason" : "Found 1 problem(s)\nline 1:15: Unknown index [broken]"
}

Full repro:

PUT broken
{ 
  "settings": {
    "index": {
        "final_pipeline": "a"
    }
  }
}

PUT working
{
  "mappings": {
    "properties": {
      "for": {
        "type": "keyword"
      }
    }
  }, 
  "settings": {
      "index": {
          "final_pipeline": "a"
      }
  }
}

GET _sql // FAILS
{
  "query": "SELECT * FROM broken"
}

GET _sql
{
  "query": "SELECT * FROM working"
}

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions