use of org.apache.calcite.sql.fun.SqlOverlapsOperator in project calcite by apache.
the class DocumentationTest method addOperators.
private void addOperators(Map<String, PatternOp> map, String prefix, List<SqlOperator> operatorList) {
for (SqlOperator op : operatorList) {
final String name = op.getName().equals("TRANSLATE3") ? "TRANSLATE" : op.getName();
if (op instanceof SqlSpecialOperator || !name.matches("^[a-zA-Z][a-zA-Z0-9_]*$")) {
continue;
}
final String regex;
if (op instanceof SqlOverlapsOperator) {
regex = "[ ]*<td>period1 " + name + " period2</td>";
} else if (op instanceof SqlFunction && (op.getOperandTypeChecker() == null || op.getOperandTypeChecker().getOperandCountRange().getMin() != 0)) {
regex = prefix + "\\| .*" + name + "\\(.*";
} else {
regex = prefix + "\\| .*" + name + ".*";
}
map.put(regex, new PatternOp(Pattern.compile(regex), name));
}
}
Aggregations