elastic / elasticsearch

Free and Open Source, Distributed, RESTful Search Engine
https://www.elastic.co/products/elasticsearch
Other
69.93k stars 24.74k forks source link

[ES|QL] CCS index with quotes fails #114201

Closed stratoula closed 5 days ago

stratoula commented 2 weeks ago

Elasticsearch Version

8.16

Installed Plugins

No response

Java Version

bundled

OS Version

Darwin Kernel Version 22.6.0

Problem Description

When we are wrapping a CCS index with quotes it fails with "Invalid index name: must not contain :"

Image

Wrapping a normal index with quotes works fine so this is a weird behavior. Also the error is confusing. CCS indexes are described with :

Steps to Reproduce

  1. Ensure that you have a CCS index
  2. Use the esql api to query this index with quotes : from "remote_cluster:index"

Logs (if relevant)

No response

elasticsearchmachine commented 2 weeks ago

Pinging @elastic/es-analytical-engine (Team:Analytics)

elasticsearchmachine commented 2 weeks ago

Pinging @elastic/kibana-esql (ES|QL-ui)

alex-spies commented 2 weeks ago

@fang-xing-esql , this looks like it's related to https://github.com/elastic/elasticsearch/pull/112081; do you wanna take a look?

bpintea commented 1 week ago

From the FROM docs:

Use enclosing double quotes (") or three enclosing double quotes (""") to escape index names that contain special characters:

FROM "this=that", """this[that"""

Whatever is in quotes in the FROM is considered an index pattern only (i.e. excluding a remote cluster name). If one needs to quote the name of the index pattern, but use a remote cluster name, that would look like FROM remoteCluster:"this=that".

So I think the failure is valid and correct.

stratoula commented 1 week ago

Hey Bogdan. I think that this was working before and I personally find this FROM remoteCluster:"this=that" a very confusing syntax 🤷‍♀

bpintea commented 1 week ago

I think that this was working before

I see. That probably happened unintentional, though given that : can't be part of an index name, supporting it intentionally should be possible.