Skip to content

_xpack returned sql_illegal_argument_exception  #31750

@jasondu168

Description

@jasondu168

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
 } 

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions