Hello,
I'm trying to convert my SQL query in JSON query so elasticsearch can find what
I look for.
This is what I have : query = "select * FROM user WHERE name='john' LIMIT 10"
It must be serialized in JSON for querying in elasticsearch like this :
"query": {
"bool": {
"must": {
"match": {
"elastic:Name": "john"
}
},
"filter": {
"term": {
"type": "User"
}
}
}
}
but instead I have this :
"query": {
"bool": {
"filter": {
"term": {
"type": "User"
}
"term": {
"elastic:Name": "john"
}
}
}
}
I found out that the code generating this filter is in the class CalcitePrepare
line 356 : "Enumerable<T> enumerable = bindable.bind(dataContext);"
and the creation of this Bindable is done in the class EnumerableInterpretable
line 140 : "return (Bindable) cbe.createInstance(new StringReader(s));"
However I can't access the bindable.bind method, it tells me that the source
code isn't available. I saw in debugger that the bindable is a "Baz" class, and
I didn't find any Baz class in the Calcite Core code...
What can I do to see the source code of the method bindable.bind() to change
the way of serializing the SQL query into JSON query ?
Thank you,
Dylan