1

I am trying to send SQL queries to elasticsearch server using the SQL API ( I am using the free version so I can't use the JDBC driver they provide) and I was wondering how I can map the result of the query since it comes back like this:

{
    "columns": [
        {
            "name": "project_id",
            "type": "text"
        }
    ],
    "rows": [
        [
            "item1"
        ],
        [
            "item2"
        ],
        [
            "item3"
        ],
        [
            "item4"
        ],
        [
            "item5"
        ],
        [
            "item6"
        ]
    ]
}'''
  • You asking how to parse json to pojo? – talex Jul 25 '21 at 07:58
  • @talex no what I want is to parse this json where the columns are the class fields and the rows are the values – Mohammad Abdulhai Jul 25 '21 at 12:27
  • Looks like you have to do it manually. There is no way you can map it with json parser. You can look at other JDBC drivers for elastic. Or go and finish one I wrote :) – talex Jul 25 '21 at 12:33

0 Answers0