ES 6.5.0 why sql statement can't use sum?

sql

(Angela Hsieh) #1

Hi,

i use like in SQL at Elasticsearch 6.4.7 is OK, but upgrade to ES 6.5.0 , it can not working.....

_xpack/sql?format=txt
{"query":"SELECT star_demo_city,sum(amt) FROM demo_test WHERE (star_demo_city like 'MEMPHIS%' or star_demo_dbo_city like 'SHELBY%') group by star_demo_city "}

the error message :

    {
    "error": {
        "root_cause": [
            {
                "type": "sql_illegal_argument_exception",
                "reason": "Cannot evaluate script for expression LikePattern[MEMPHIS%,\u0000]"
            }
        ],
        "type": "sql_illegal_argument_exception",
        "reason": "Cannot evaluate script for expression LikePattern[MEMPHIS%,\u0000]"
    },
    "status": 500
}

if i delete "SUM(amt)" , the sql is working......

is there any way to solve it?


(Andrei Stefan) #2

Hi @Angela_Hsieh,
Thank you for bringing this one up. Indeed, a bug. I've created a bug report: https://github.com/elastic/elasticsearch/issues/36161 and we'll look into it.


(Angela Hsieh) #3

thanks for your reply, hope ES is better and better !