Java Code Examples for org.apache.calcite.sql.SqlFunctionCategory#isUserDefinedNotSpecificFunction()

The following examples show how to use org.apache.calcite.sql.SqlFunctionCategory#isUserDefinedNotSpecificFunction() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ListSqlOperatorTable.java    From Bats with Apache License 2.0 6 votes vote down vote up
public void lookupOperatorOverloads(SqlIdentifier opName,
    SqlFunctionCategory category,
    SqlSyntax syntax,
    List<SqlOperator> operatorList) {
  for (SqlOperator operator : this.operatorList) {
    if (operator.getSyntax() != syntax) {
      continue;
    }
    if (!opName.isSimple()
        || !operator.isName(opName.getSimple())) {
      continue;
    }
    if (category != null
        && category != category(operator)
        && !category.isUserDefinedNotSpecificFunction()) {
      continue;
    }
    operatorList.add(operator);
  }
}
 
Example 2
Source File: ListSqlOperatorTable.java    From calcite with Apache License 2.0 6 votes vote down vote up
public void lookupOperatorOverloads(SqlIdentifier opName,
    SqlFunctionCategory category,
    SqlSyntax syntax,
    List<SqlOperator> operatorList,
    SqlNameMatcher nameMatcher) {
  for (SqlOperator operator : this.operatorList) {
    if (operator.getSyntax() != syntax) {
      continue;
    }
    if (!opName.isSimple()
        || !nameMatcher.matches(operator.getName(), opName.getSimple())) {
      continue;
    }
    if (category != null
        && category != category(operator)
        && !category.isUserDefinedNotSpecificFunction()) {
      continue;
    }
    operatorList.add(operator);
  }
}
 
Example 3
Source File: LookupOperatorOverloadsTest.java    From calcite with Apache License 2.0 5 votes vote down vote up
@Test void testIsUserDefinedNotSpecificFunction() throws SQLException {
  List<SqlFunctionCategory> cats = new ArrayList<>();
  for (SqlFunctionCategory sqlFunctionCategory : SqlFunctionCategory.values()) {
    if (sqlFunctionCategory.isUserDefinedNotSpecificFunction()) {
      cats.add(sqlFunctionCategory);
    }
  }
  check(cats, USER_DEFINED_FUNCTION, USER_DEFINED_TABLE_FUNCTION);
}
 
Example 4
Source File: FunctionCatalogOperatorTable.java    From flink with Apache License 2.0 4 votes vote down vote up
private boolean isNotUserFunction(SqlFunctionCategory category) {
	return category != null && !category.isUserDefinedNotSpecificFunction();
}
 
Example 5
Source File: FunctionCatalogOperatorTable.java    From flink with Apache License 2.0 4 votes vote down vote up
private boolean isNotUserFunction(SqlFunctionCategory category) {
	return category != null && !category.isUserDefinedNotSpecificFunction();
}
 
Example 6
Source File: FunctionCatalogOperatorTable.java    From flink with Apache License 2.0 4 votes vote down vote up
private boolean isNotUserFunction(SqlFunctionCategory category) {
	return category != null && !category.isUserDefinedNotSpecificFunction();
}