You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] timechart command with zero span throws execution exception #4527
I quick tested timechart command and found negative span value is not allowed in our grammar. But zero-span validation is missing. Let me create an issue and raise separate PR to fix.
opensearchsql> source=test_data_2023 | timechart span=0m per_second(packets);
TransportError(500, 'SearchPhaseExecutionException', {'error':
{'reason':'Error occurred in OpenSearch engine: all shards failed', 'details': 'Shard[0]:
java.lang.IllegalArgumentException: Zero or negative time interval not supported\n\n
For more details, please send request for Json format to see the raw response from OpenSearch engine.',
'type': 'SearchPhaseExecutionException'}, 'status': 400})
opensearchsql> source=test_data_2023 | timechart span=-1m per_second(packets);
{'reason': 'Invalid Query', 'details': "[-] is not a valid term at this part of the query: '...23
| timechart span=-' <-- HERE. extraneous input '-' expecting {SPANLENGTH, INTEGER_LITERAL}",
'type': 'SyntaxCheckException'}
Caused by: java.lang.IllegalArgumentException: Zero or negative time interval not supported
at org.opensearch.common.Rounding$Builder.<init>(Rounding.java:380)
at org.opensearch.common.Rounding.builder(Rounding.java:356)
at org.opensearch.search.aggregations.bucket.histogram.DateIntervalWrapper.createRounding(DateIntervalWrapper.java:300)
at org.opensearch.search.aggregations.bucket.composite.DateHistogramValuesSourceBuilder.innerBuild(DateHistogramValuesSourceBuilder.java:346)
at org.opensearch.search.aggregations.bucket.composite.CompositeValuesSourceBuilder.build(CompositeValuesSourceBuilder.java:337)
at org.opensearch.search.aggregations.bucket.composite.CompositeAggregationBuilder.doBuild(CompositeAggregationBuilder.java:296)
...
Activity
dai-chen commentedon Oct 13, 2025
Exception: