Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Type information is lost in JDBC format #316

Closed
dai-chen opened this issue Dec 11, 2019 · 0 comments
Closed

Type information is lost in JDBC format #316

dai-chen opened this issue Dec 11, 2019 · 0 comments
Assignees
Labels
bug Something isn't working JDBC/ODBC formatting This issue is related to JDBC or ODBC driver client

Comments

@dai-chen
Copy link
Member

In JDBC formatter, we need to return a type for each field in SELECT which is required by JDBC driver. However, this type is hardcoding for now. For example, SUM always return double even if the field given is an integer.

GET kibana_sample_data_flights/_mapping
{
  "kibana_sample_data_flights" : {
    "mappings" : {
      "properties" : {
        ...
        "FlightDelayMin" : {
          "type" : "integer"
        },
       ...
      }
    }
  }
}

POST _opendistro/_sql?format=jdbc
{
  "query": "SELECT SUM(FlightDelayMin) FROM kibana_sample_data_flights"
}
{
  "schema": [{
    "name": "SUM(FlightDelayMin)",
    "type": "double"
  }],
  "total": 1,
  "datarows": [["618150.0"]],
  "size": 1,
  "status": 200
}
@dai-chen dai-chen added the bug Something isn't working label Dec 11, 2019
@dai-chen dai-chen added this to the 1/2020-Release milestone Dec 11, 2019
@dai-chen dai-chen added the JDBC/ODBC formatting This issue is related to JDBC or ODBC driver client label Jan 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working JDBC/ODBC formatting This issue is related to JDBC or ODBC driver client
Projects
None yet
Development

No branches or pull requests

2 participants