Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Describe statement doesn't work for index alias #725

Closed
dai-chen opened this issue Sep 1, 2020 · 1 comment
Closed

Describe statement doesn't work for index alias #725

dai-chen opened this issue Sep 1, 2020 · 1 comment
Assignees
Labels
enhancement New feature or request SQL

Comments

@dai-chen
Copy link
Member

dai-chen commented Sep 1, 2020

When DESCRIBE statement is used against an index alias, no result is returned.

PUT dropdown-region-marketplace
{
  "mappings": {
    "properties": {
      "balance": {
        "type": "float"
      },
      "age": {
        "type": "integer"
      }
    }
  }
}

# Work without issue
POST _opendistro/_sql
{
  "query": "DESCRIBE TABLES LIKE dropdown-region-marketplace"
}

# Empty result returned
PUT /dropdown-region-marketplace/_alias/ddregionmarketplace
POST _opendistro/_sql
{
  "query": "DESCRIBE TABLES LIKE ddregionmarketplace"
}
{
 ...
  "total": 0,
  "datarows": [],
  "size": 0,
  "status": 200
}
@dai-chen dai-chen added enhancement New feature or request SQL labels Sep 1, 2020
@dai-chen
Copy link
Member Author

dai-chen commented Sep 1, 2020

I debugged code and found that we tried to match the index name returned in ES get mapping API and pattern in query. In the case of index alias, index name rather than alias is returned in get mapping API response. Thus it is unable to match the original pattern text in query.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request SQL
Projects
None yet
Development

No branches or pull requests

2 participants