amazon-archives / sql-jdbc

🔍 Open Distro for Elasticsearch JDBC Driver
Apache License 2.0
111 stars 49 forks source link

using jdbc, some sql functions seem not work normally #23

Closed jianhong2014 closed 5 years ago

jianhong2014 commented 5 years ago

e.g. date_format works normally using postman, but doesn't work in java env

dai-chen commented 5 years ago

e.g. date_format works normally using postman, but doesn't work in java env

Hey @jianhong2014 , could you provide more information so we can duplicate the issue? Such as your env, data and query etc.

jianhong2014 commented 5 years ago

image

jianhong2014 commented 5 years ago

image

jianhong2014 commented 5 years ago

image

dai-chen commented 5 years ago

Thanks for the update! Will look into the issue and request more information if needed.

jianhong2014 commented 5 years ago

any update? if possible,we can talk directly

galkk commented 5 years ago

Hello @jianhong2014

Thanks for the feedback. Could you clarify couple of quiestions

  1. Which version of the driver you are using?
  2. Could you show the ouput of your query from Kibana, using this as an example
GET /_opendistro/_sql?format=jdbc
{
  "query": """
  SELECT date_format(utc_time, 'Y-MM-dd') x, count(*) 
  FROM kibana_sample_data_logs
  WHERE host='www.elastic.co'
  GROUP BY date_format(utc_time, 'Y-MM-dd')
  """
}

GET /_opendistro/_sql?format=jdbc
{
  "query": """
  SELECT date_format(utc_time, 'Y-MM-dd') x, count(*) 
  FROM kibana_sample_data_logs
  WHERE host='www.elastic.co'
  GROUP BY x
  """
}