Skip to content

Conversation

@astefan
Copy link
Contributor

@astefan astefan commented Feb 28, 2020

Until now, when a query was executed against an index that had no mapping a misleading "index not found" error message was issued. This PR fixes this error message by pointing out the columns not being found instead.

Fixes #52865.

@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search (:Search/SQL)

Copy link
Contributor

@matriv matriv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@costin costin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one!

assertFoundOneProblem(command("SELECT * FROM test"));
//assertEquals("line 1:15: [test] doesn't have any types so it is incompatible with sql" + END, readLine());
assertEquals("line 1:15: Unknown index [test]" + END, readLine());
assertEquals("line 1:8: Cannot determine columns for [*]" + END, readLine());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is incorrect - if we know the index is empty, we should return no columns since we can determine them and know there are none.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created #53001

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

5 participants