The examples below use the OpenSearch Dashboards sample data (specifically the indexes opensearch_dashboards_sample_data_logs and opensearch_dashboards_sample_data_flights).
{
"error": {
"context": {
"stage": "executing",
"plan": "LogicalSystemLimit(sort0=[$20], dir0=[DESC], fetch=[10000], type=[QUERY_SIZE_LIMIT])\
LogicalProject(referer=[$0], request=[$1], agent=[$2], extension=[$3], memory=[$4], ip=[$5], index=[$6], message=[$7], url=[$8], tags=[$9], geo=[$10], utc_time=[$15], bytes=[$16], machine=[$17], response=[$20], clientip=[$21], host=[$22], event=[$23], phpmemory=[$25], timestamp=[$26], @timestamp=[$27])\
LogicalSort(sort0=[$27], dir0=[DESC])\
LogicalUnion(all=[true])\
LogicalProject(referer=[$0], request=[$1], agent=[$2], extension=[$3], memory=[$4], ip=[$5], index=[$6], message=[$7], url=[$8], tags=[$9], geo=[$10], geo.coordinates=[$11], geo.dest=[$12], geo.src=[$13], geo.srcdest=[$14], utc_time=[$15], bytes=[$16], machine=[$17], machine.os=[$18], machine.ram=[$19], response=[$20], clientip=[$21], host=[$22], event=[$23], event.dataset=[$24], phpmemory=[$25], timestamp=[$26], @timestamp=[$33])\
LogicalFilter(condition=[=($13, 'IT')])\
LogicalProject(referer=[$0], request=[$1], agent=[$2], extension=[$3], memory=[$4], ip=[$5], index=[$6], message=[$7], url=[$8], tags=[$9], geo=[$10], geo.coordinates=[$11], geo.dest=[$12], geo.src=[$13], geo.srcdest=[$14], utc_time=[$15], bytes=[$16], machine=[$17], machine.os=[$18], machine.ram=[$19], response=[$20], clientip=[$21], host=[$22], event=[$23], event.dataset=[$24], phpmemory=[$25], timestamp=[$26], _id=[$27], _index=[$28], _score=[$29], _maxscore=[$30], _sort=[$31], _routing=[$32], @timestamp=[$26])\
CalciteLogicalIndexScan(table=[[OpenSearch, opensearch_dashboards_sample_data_logs]])\
LogicalProject(referer=[$0], request=[$1], agent=[$2], extension=[$3], memory=[$4], ip=[$5], index=[$6], message=[$7], url=[$8], tags=[$9], geo=[$10], geo.coordinates=[$11], geo.dest=[$12], geo.src=[$13], geo.srcdest=[$14], utc_time=[$15], bytes=[$16], machine=[$17], machine.os=[$18], machine.ram=[$19], response=[$20], clientip=[$21], host=[$22], event=[$23], event.dataset=[$24], phpmemory=[$25], timestamp=[$26], @timestamp=[$33])\
LogicalFilter(condition=[=($13, 'US')])\
LogicalProject(referer=[$0], request=[$1], agent=[$2], extension=[$3], memory=[$4], ip=[$5], index=[$6], message=[$7], url=[$8], tags=[$9], geo=[$10], geo.coordinates=[$11], geo.dest=[$12], geo.src=[$13], geo.srcdest=[$14], utc_time=[$15], bytes=[$16], machine=[$17], machine.os=[$18], machine.ram=[$19], response=[$20], clientip=[$21], host=[$22], event=[$23], event.dataset=[$24], phpmemory=[$25], timestamp=[$26], _id=[$27], _index=[$28], _score=[$29], _maxscore=[$30], _sort=[$31], _routing=[$32], @timestamp=[$26])\
CalciteLogicalIndexScan(table=[[OpenSearch, opensearch_dashboards_sample_data_logs]])",
"stage_description": "Running the query"
},
"reason": "Error while preparing plan [LogicalSystemLimit(sort0=[$20], dir0=[DESC], fetch=[10000], type=[QUERY_SIZE_LIMIT])\
LogicalProject(referer=[$0], request=[$1], agent=[$2], extension=[$3], memory=[$4], ip=[$5], index=[$6], message=[$7], url=[$8], tags=[$9], geo=[$10], utc_time=[$15], bytes=[$16], machine=[$17], response=[$20], clientip=[$21], host=[$22], event=[$23], phpmemory=[$25], timestamp=[$26], @timestamp=[$27])\
LogicalSort(sort0=[$27], dir0=[DESC])\
LogicalUnion(all=[true])\
LogicalProject(referer=[$0], request=[$1], agent=[$2], extension=[$3], memory=[$4], ip=[$5], index=[$6], message=[$7], url=[$8], tags=[$9], geo=[$10], geo.coordinates=[$11], geo.dest=[$12], geo.src=[$13], geo.srcdest=[$14], utc_time=[$15], bytes=[$16], machine=[$17], machine.os=[$18], machine.ram=[$19], response=[$20], clientip=[$21], host=[$22], event=[$23], event.dataset=[$24], phpmemory=[$25], timestamp=[$26], @timestamp=[$33])\
LogicalFilter(condition=[=($13, 'IT')])\
LogicalProject(referer=[$0], request=[$1], agent=[$2], extension=[$3], memory=[$4], ip=[$5], index=[$6], message=[$7], url=[$8], tags=[$9], geo=[$10], geo.coordinates=[$11], geo.dest=[$12], geo.src=[$13], geo.srcdest=[$14], utc_time=[$15], bytes=[$16], machine=[$17], machine.os=[$18], machine.ram=[$19], response=[$20], clientip=[$21], host=[$22], event=[$23], event.dataset=[$24], phpmemory=[$25], timestamp=[$26], _id=[$27], _index=[$28], _score=[$29], _maxscore=[$30], _sort=[$31], _routing=[$32], @timestamp=[$26])\
CalciteLogicalIndexScan(table=[[OpenSearch, opensearch_dashboards_sample_data_logs]])\
LogicalProject(referer=[$0], request=[$1], agent=[$2], extension=[$3], memory=[$4], ip=[$5], index=[$6], message=[$7], url=[$8], tags=[$9], geo=[$10], geo.coordinates=[$11], geo.dest=[$12], geo.src=[$13], geo.srcdest=[$14], utc_time=[$15], bytes=[$16], machine=[$17], machine.os=[$18], machine.ram=[$19], response=[$20], clientip=[$21], host=[$22], event=[$23], event.dataset=[$24], phpmemory=[$25], timestamp=[$26], @timestamp=[$33])\
LogicalFilter(condition=[=($13, 'US')])\
LogicalProject(referer=[$0], request=[$1], agent=[$2], extension=[$3], memory=[$4], ip=[$5], index=[$6], message=[$7], url=[$8], tags=[$9], geo=[$10], geo.coordinates=[$11], geo.dest=[$12], geo.src=[$13], geo.srcdest=[$14], utc_time=[$15], bytes=[$16], machine=[$17], machine.os=[$18], machine.ram=[$19], response=[$20], clientip=[$21], host=[$22], event=[$23], event.dataset=[$24], phpmemory=[$25], timestamp=[$26], _id=[$27], _index=[$28], _score=[$29], _maxscore=[$30], _sort=[$31], _routing=[$32], @timestamp=[$26])\
CalciteLogicalIndexScan(table=[[OpenSearch, opensearch_dashboards_sample_data_logs]])\
]",
"details": "class org.apache.calcite.plan.RelCompositeTrait cannot be cast to class org.apache.calcite.rel.RelCollation (org.apache.calcite.plan.RelCompositeTrait and org.apache.calcite.rel.RelCollation are in unnamed module of loader java.net.URLClassLoader @2ee18aca)",
"location": [
"while running the query",
"while compiling the optimized query plan for physical execution"
],
"code": "PLANNING_ERROR",
"type": "SQLException"
},
"status": 500
}
What is the bug?
When doing a multisearch with two (or more) subsearches, the multisearch fails if the
@timestampfield is an alias to another field.The examples below use the OpenSearch Dashboards sample data (specifically the indexes
opensearch_dashboards_sample_data_logsandopensearch_dashboards_sample_data_flights).The mappings for the `opensearch_dashboards_sample_data_logs` are: (expandable section)
The mappings for the `opensearch_dashboards_sample_data_flights` are: (expandable section)
The following query:
fails with the following error:
Selecting the
timestampfield (with thefieldscommand) like in the following query will fail in the same way.IMPORTANT! Weirdly enough, selecting the
@timestampfield will make the query succeed.The
opensearch_dashboards_sample_data_flightsindex does not have this problem. The following query succeeds:Furthermore, doing a multisearch that includes both the
opensearch_dashboards_sample_data_logsandopensearch_dashboards_sample_data_flightsindexes will succeed, as seen below:The result for the query above: (expandable section)
How can one reproduce the bug?
Steps to reproduce the behavior:
/app/home#/tutorial_directoryURL path and add the "Sample web logs" and "Sample flight data".What is the expected behavior?
The query should not fail with a Java class cast exception and return the union of all the rows in all subsearches, together with all their fields.
What is your host/environment?
Do you have any screenshots?
N/A
Do you have any additional context?
A few more examples of queries that work:
A few more examples of queries that do not work: