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

SQL:: Unable To Aggregate and Like in statement #36572

Closed
Johnb21 opened this issue Dec 12, 2018 · 3 comments
Closed

SQL:: Unable To Aggregate and Like in statement #36572

Johnb21 opened this issue Dec 12, 2018 · 3 comments
Labels

Comments

@Johnb21
Copy link

Johnb21 commented Dec 12, 2018

Elasticsearch 6.5

I am trying to use the SQL Component with a pretty basic query that uses a combination of a SUM aggregate function and a LIKE filter.

SELECT SUM(amount) as total_amount
FROM res
WHERE id = '1234'
AND description LIKE '%desc'

If i remove the aggregate, I get each line item with no errors. This tells me the LIKE is working properly. The same is true removing the LIKE filter and running it with just the SUM aggregate. It works.

When I use both like the query above, I get the following error:

{
  "error": {
    "root_cause": [
      {
        "type": "sql_illegal_argument_exception",
        "reason": "Cannot evaluate script for expression LikePattern[%desc,\u0000]"
      }
    ],
    "type": "sql_illegal_argument_exception",
    "reason": "Cannot evaluate script for expression LikePattern[%desc,\u0000]"
  },
  "status": 500
}
@tpcred
Copy link

tpcred commented Dec 12, 2018

I'll try to tackle this one.

@tlrx tlrx added >bug :Analytics/SQL SQL querying labels Dec 13, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search

@astefan
Copy link
Contributor

astefan commented Dec 13, 2018

@Johnb21 thank you for the report, but this was already reported before here. Closing as a duplicate.

@astefan astefan closed this as completed Dec 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants