Skip to content

_xpack returned sql_illegal_argument_exception #31750

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

Closed
jasondu168 opened this issue Jul 2, 2018 · 4 comments · Fixed by #31777
Closed

_xpack returned sql_illegal_argument_exception #31750

jasondu168 opened this issue Jul 2, 2018 · 4 comments · Fixed by #31777
Labels

Comments

@jasondu168
Copy link

Elasticsearch version (6.3):

Plugins installed: [_xpack]

JVM version (1.8.0_161-b14):

OS version (Linux 3.10.0-327.10.1.el7.x86_64):

Description of the problem including expected versus actual behavior:
Got sql_illegal_argument_exception when getting data from elastic search using _xpack/sql.

uri: http://${host}/_xpack/sql?format=json

SQL:

select created_at, device_id from table1 where  created_at > 1527982201597 AND user_id = '12345678'

Error:

Steps to reproduce:

  1. use the code (js) below to post a request.
let options = {
    method: 'POST',
    uri: `http://${hosts}/_xpack/sql?format=json`,
    body: {"query": `select created_at, device_id from table1 where  created_at > 1527982201597 AND user_id = '12345678'`},
    json: true
  };
  return rp(options);
  1. Got exception in the result.
    The created_at is date type and 1527982201597 is milliseconds.

Provide logs (if relevant):

{ error:
   { root_cause: [ [Object] ],
     type: 'sql_illegal_argument_exception',
     reason: '[1527982201597] out of [Int] range' },
    status: 500
 } 
@tvernum tvernum added the :Analytics/SQL SQL querying label Jul 3, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search-aggs

@javanna
Copy link
Member

javanna commented Jul 3, 2018

Thoughts @costin and team? Seems like some field should be a long rather than an int, but just a wild guess.

@javanna javanna added the >bug label Jul 3, 2018
@costin
Copy link
Member

costin commented Jul 3, 2018

Needs more investigation to figure out the cause. Looks likely to be a bug in parsing which doesn't multiple integer types to find the right size.

@costin
Copy link
Member

costin commented Jul 3, 2018

@jdu-mydevices Thanks for the (clear) bug report.
I've been able to reproduce the issue and created a PR for it (#31777) which will track when and in what versions it will be pushed.

Thanks!

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

Successfully merging a pull request may close this issue.

5 participants