use of org.apache.druid.sql.calcite.expression.SqlOperatorConversion in project druid by druid-io.
the class DruidOperatorTable method lookupOperatorOverloads.
@Override
public void lookupOperatorOverloads(final SqlIdentifier opName, final SqlFunctionCategory category, final SqlSyntax syntax, final List<SqlOperator> operatorList, final SqlNameMatcher nameMatcher) {
if (opName == null) {
return;
}
if (opName.names.size() != 1) {
return;
}
final OperatorKey operatorKey = OperatorKey.of(opName.getSimple(), syntax);
final SqlAggregator aggregator = aggregators.get(operatorKey);
if (aggregator != null) {
operatorList.add(aggregator.calciteFunction());
}
final SqlOperatorConversion operatorConversion = operatorConversions.get(operatorKey);
if (operatorConversion != null) {
operatorList.add(operatorConversion.calciteOperator());
}
final SqlOperator convertletOperator = CONVERTLET_OPERATORS.get(operatorKey);
if (convertletOperator != null) {
operatorList.add(convertletOperator);
}
}
use of org.apache.druid.sql.calcite.expression.SqlOperatorConversion in project druid by druid-io.
the class DruidOperatorTable method getOperatorList.
@Override
public List<SqlOperator> getOperatorList() {
final List<SqlOperator> retVal = new ArrayList<>();
for (SqlAggregator aggregator : aggregators.values()) {
retVal.add(aggregator.calciteFunction());
}
for (SqlOperatorConversion operatorConversion : operatorConversions.values()) {
retVal.add(operatorConversion.calciteOperator());
}
retVal.addAll(DruidConvertletTable.knownOperators());
return retVal;
}
Aggregations