Hi,
I have an index worktop_process
with nested field:
{
"orderId": {
"type": "integer"
},
"shipments": {
"type": "nested",
"dynamic": "strict",
"properties": {
"estimatedReceivingDate": {
"type": "date"
},
"packageId": {
"type": "keyword"
},
"receivingDate": {
"type": "date"
}
}
}
}
And I have the following query to search for all packages that should have been received but not:
POST _sql?format=txt
{
"query": "select orderId, shipments.receivingDate from worktop_process where shipments.receivingDate is null and shipments.estimatedReceivingDate < now()"
}
It returns an exception:
"root_cause": [
{
"type": "illegal_argument_exception",
"reason": "[inner_hits] already contains an entry for key [shipments]"
}
]
But when I removed the nested field from sql return column list, the query works:
POST _sql?format=txt
{
"query": "select orderId from worktop_process where shipments.receivingDate is null and shipments.estimatedReceivingDate < now()"
}
How is this error to be understood and is there any way work around it?
Thanks in advance.