Versions (relevant - OpenSearch/Dashboard/Server OS/Browser):2.19.4 and 2.18.0
Describe the issue: SQL plugin does not return correct data if below query is executed
POST: _plugins/_sql
{ “query”:"SELECT COUNT(*) AS COUNT FROM `index_name` WHERE `containerName`= ‘Mobiles’ AND (`attributes.Phone Spec.URL` IS NULL) "}
Response:
{
“error”: {
“reason”: “Invalid SQL query”,
“details”: “can’t resolve Symbol(namespace=FIELD_NAME, name=attributes.Phone Spec.URL) in type env”,
“type”: “SemanticCheckException”
},
“status”: 400
}
Configuration: below JSON data is indexed in opensearch
{
“_index”: “42”,
“_id”: “122233”,
“_score”: 8.534866,
“_source”: {
“type”: “ITEM”,
“companyName”: “Datanew”,
“containerName”: “Mobiles”,
“primaryKey”: “item3”,
“displayName”: “item3”,
“attributes”: {
“Phone Spec”: {
“URL”: null,
“Accessories”: null,
}
},
"mappings": {
},
"dataCompletenessPercent": [],
"validationErrorCount": 0,
"versionNumber": 1
}
}
Relevant Logs or Screenshots: We can search items is indexed using API /_search?q=*