Skip to content

[BUG] DESCRIBE query returns incorrect data for text fields #259

@Yury-Fridlyand

Description

@Yury-Fridlyand

Describe the bug
DESCRIBE query returns incorrect data for fields of keyword type

To Reproduce
Steps to reproduce the behavior:

  1. Create test data using sample given:
curl -s -H 'Content-Type: application/x-ndjson' -XPUT 'https://localhost:9200/dbg?pretty' -u admin:admin --insecure --data-binary @dbg_mappings.json
  1. Execute SHOW TABLES LIKE dbg; and DESCRIBE TABLES LIKE dbg;:
curl -XPOST http://localhost:9200/_plugins/_sql -H 'Content-Type: application/json' -d '{"query": "show tables like dbg"}' -q
curl -XPOST http://localhost:9200/_plugins/_sql -H 'Content-Type: application/json' -d '{"query": "describe tables like dbg"}' -q

Actual behavior
The schema description and the output of describe query report that the data type is keyword. keyword is not a SQL data type.

Expected behavior
The data type should be [n]text or [n][var]char

Plugins
The default set:

curl "localhost:9200/_cat/plugins?h=component&pretty=true"
mapper-murmur3
opensearch-alerting
opensearch-anomaly-detection
opensearch-asynchronous-search
opensearch-index-management
opensearch-job-scheduler
opensearch-knn
opensearch-notebooks
opensearch-performance-analyzer
opensearch-reports-scheduler
opensearch-security
opensearch-sql
Host/Environment (please complete the following information):
Docker container v.1.0.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    SQLbugSomething isn't workingtdvtTableau test framework

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions