xiedeyantu commented on code in PR #4434:
URL: https://github.com/apache/calcite/pull/4434#discussion_r2162928367
##########
elasticsearch/src/main/java/org/apache/calcite/adapter/elasticsearch/QueryBuilders.java:
##########
@@ -499,12 +501,27 @@ static class RegexpQueryBuilder extends QueryBuilder {
private final String value;
RegexpQueryBuilder(final String fieldName, final String value) {
+ requireNonNull(fieldName, "fieldName");
+ requireNonNull(value, "value");
this.fieldName = fieldName;
- this.value = value;
+ // replace % to * and _ to ? for sql with like operator
+ this.value = replaceWildcard(replaceWildcard(value, "%", "*"), "_", "?");
Review Comment:
Maybe the string contains a `%`, it may need such wildcard characters like
'%\%%'. I don't know if Calcite supports writing like this.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]