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

Several functions works inproperly with fieldvalue/constant parameters #291

Closed
chloe-zh opened this issue Nov 16, 2019 · 3 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@chloe-zh
Copy link
Member

Related issue: #279

Another example:

POST _opendistro/_sql?format=jdbc
{
  "query" : "SELECT year(timestamp) FROM kibana_sample_data_flights limit 1"
}

Result:

{
  "schema": [{
    "name": "year_1",
    "type": "text"
  }],
  "total": 10000,
  "datarows": [[2019]],
  "size": 1,
  "status": 200
}

However, if the query looks like:

POST _opendistro/_sql?format=jdbc
{
  "query" : "SELECT year('2019-10-14T00:00:00') FROM kibana_sample_data_flights limit 1"

Then it doesn't work with output:

{
  "error": {
    "reason": "There was internal problem at backend",
    "details": "all shards failed",
    "type": "SearchPhaseExecutionException"
  },
  "status": 500
}
@chloe-zh chloe-zh added the bug Something isn't working label Nov 16, 2019
@chloe-zh chloe-zh self-assigned this Nov 16, 2019
@chloe-zh
Copy link
Member Author

Currently, functions ASIN, RANDOM, DATE_FORMAT, UPPER, LOWER, TRIM etc. are not working well resulted from the documentation demo from @dai-chen . In addition,I will do a double check to complete a list of functions with improper behaviors before making code changes.

@davidcui1225
Copy link
Contributor

What is the behavior of MySql? Does it just return 2019?

@chloe-zh
Copy link
Member Author

What is the behavior of MySql? Does it just return 2019?

@davidcui-amzn Yes it is. So the thing is some functions are not supported to put a field as the input param, some are not supported to put a constant as the param. :(

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants