Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Support wildcard in column names in V2 #1487

Open
Yury-Fridlyand opened this issue Mar 30, 2023 · 0 comments
Open

[FEATURE] Support wildcard in column names in V2 #1487

Yury-Fridlyand opened this issue Mar 30, 2023 · 0 comments

Comments

@Yury-Fridlyand
Copy link
Collaborator

Is your feature request related to a problem?

$ curl -s -XPOST http://localhost:9200/_plugins/_sql -H 'Content-Type: application/json' -d '{"query": "SELECT date* from calcs"}'  | jq
{
  "error": {
    "reason": "Invalid SQL query",
    "details": "can't resolve Symbol(namespace=FIELD_NAME, name=date*) in type env",
    "type": "SemanticCheckException"
  },
  "status": 400
}

What solution would you like?

$ curl -s -XPOST http://localhost:9200/_plugins/_sql -H 'Content-Type: application/json' -d '{"query": "SELECT date* from calcs limit 1", "legacy": 1}'  | jq
{
  "schema": [
    {
      "name": "datetime0",
      "type": "date"
    },
    {
      "name": "date3",
      "type": "date"
    },
    {
      "name": "datetime1",
      "type": "date"
    },
    {
      "name": "date2",
      "type": "date"
    },
    {
      "name": "date1",
      "type": "date"
    },
    {
      "name": "date0",
      "type": "date"
    }
  ],
  "total": 17,
  "datarows": [
    [
      "2004-07-09 10:17:35.000",
      "1986-03-20",
      null,
      "1977-04-20",
      "2004-04-01",
      "2004-04-15"
    ]
  ],
  "size": 1,
  "status": 200
}

What alternatives have you considered?
N/A

Do you have any additional context?
Don't resolve * (e.g. in SELECT *) to a list of column names, keep it as *.

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

No branches or pull requests

2 participants