$ curl -X POST "localhost:9200/_xpack/sql?format=txt&pretty" -H 'Content-Type: application/json' -d'
{
"query": "SELECT count(*) FROM whatsapp_202010 WHERE clientInfo.customerId = 7503"
}
'
count(*)
---------------
241176
I'm having issues to use with timestamp:
Using "... AND requestDatetimes.routedAt >= "2020-10-19T00:00:00":
Error : "reason" : "Unexpected character ('2' (code 50)): was expecting comma to separate Object entries\n at [Source: org.elasticsearch.transport.netty4.ByteBufStreamInput@336a791e; line: 3, column: 122]"
Using "... AND requestDatetimes.routedAt >= '2020-10-19T00:00:00'"
Error: reason" : "line 1:114: identifiers must not start with a digit; please use double quotes"
Using "... AND requestDatetimes.routedAt >= \"2020-10-19T00:00:00\""
Sure, and that's probably closer to what you wanted anyways, I guess.
For the record, single quoting as you initially wanted is possible too, but depending on your shell, you might need to use the "ansi c quoting", i.e. something like:
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.