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
What is the bug?
When executing a SQL query with REGEXP filter, get the following exception:
{
"error": {
"reason": "Error occurred in OpenSearch engine: all shards failed",
"details": "Shard[0]: java.lang.IllegalStateException: Expression has wrong result type instead of boolean: expression [regexp(field1, \"test.*\")], result [1]\n\nFor more details, please send request for Json format to see the raw response from OpenSearch engine.",
"type": "SearchPhaseExecutionException"
},
"status": 500
}
How can one reproduce the bug?
Steps to reproduce the behavior:
{
"query": "SELECT field1 FROM test WHERE field1 REGEXP 'test.*'"
}
Do you have any additional context?
The root cause of this bug may be because what ExpressionFilterScript#evaluateExpression expects is a boolean value:
If we modify the return type of OperatorUtils#matchesRegexp, it will impact the return type of the REGEXP function, which could be a breaking change. To avoid this, we could consider converting the integer value to a boolean value in ExpressionFilterScript#evaluateExpression.
The text was updated successfully, but these errors were encountered:
What is the bug?
When executing a SQL query with REGEXP filter, get the following exception:
How can one reproduce the bug?
Steps to reproduce the behavior:
Do you have any additional context?
The root cause of this bug may be because what
ExpressionFilterScript#evaluateExpression
expects is a boolean value:sql/opensearch/src/main/java/org/opensearch/sql/opensearch/storage/script/filter/ExpressionFilterScript.java
Lines 51 to 57 in 4326396
but what
OperatorUtils#matchesRegexp
returns is an integer value:sql/core/src/main/java/org/opensearch/sql/utils/OperatorUtils.java
Lines 37 to 40 in 4326396
If we modify the return type of
OperatorUtils#matchesRegexp
, it will impact the return type of the REGEXP function, which could be a breaking change. To avoid this, we could consider converting the integer value to a boolean value inExpressionFilterScript#evaluateExpression
.The text was updated successfully, but these errors were encountered: