use of org.apache.calcite.sql.SqlFunctionCategory in project calcite by apache.
the class LookupOperatorOverloadsTest method testIsTableFunction.
@Test
public void testIsTableFunction() throws SQLException {
List<SqlFunctionCategory> cats = new ArrayList<>();
for (SqlFunctionCategory c : SqlFunctionCategory.values()) {
if (c.isTableFunction()) {
cats.add(c);
}
}
check(cats, USER_DEFINED_TABLE_FUNCTION, USER_DEFINED_TABLE_SPECIFIC_FUNCTION, MATCH_RECOGNIZE);
}
use of org.apache.calcite.sql.SqlFunctionCategory in project calcite by apache.
the class LookupOperatorOverloadsTest method testIsUserDefined.
@Test
public void testIsUserDefined() throws SQLException {
List<SqlFunctionCategory> cats = new ArrayList<>();
for (SqlFunctionCategory c : SqlFunctionCategory.values()) {
if (c.isUserDefined()) {
cats.add(c);
}
}
check(cats, USER_DEFINED_FUNCTION, USER_DEFINED_PROCEDURE, USER_DEFINED_CONSTRUCTOR, USER_DEFINED_SPECIFIC_FUNCTION, USER_DEFINED_TABLE_FUNCTION, USER_DEFINED_TABLE_SPECIFIC_FUNCTION);
}
use of org.apache.calcite.sql.SqlFunctionCategory in project calcite by apache.
the class LookupOperatorOverloadsTest method testIsUserDefinedNotSpecificFunction.
@Test
public 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);
}
use of org.apache.calcite.sql.SqlFunctionCategory in project calcite by apache.
the class LookupOperatorOverloadsTest method testIsSpecific.
@Test
public void testIsSpecific() throws SQLException {
List<SqlFunctionCategory> cats = new ArrayList<>();
for (SqlFunctionCategory c : SqlFunctionCategory.values()) {
if (c.isSpecific()) {
cats.add(c);
}
}
check(cats, USER_DEFINED_SPECIFIC_FUNCTION, USER_DEFINED_TABLE_SPECIFIC_FUNCTION);
}
use of org.apache.calcite.sql.SqlFunctionCategory in project flink by apache.
the class FunctionCatalogOperatorTable method lookupOperatorOverloads.
@Override
public void lookupOperatorOverloads(SqlIdentifier opName, SqlFunctionCategory category, SqlSyntax syntax, List<SqlOperator> operatorList, SqlNameMatcher nameMatcher) {
if (opName.isStar()) {
return;
}
final UnresolvedIdentifier identifier = UnresolvedIdentifier.of(opName.names);
functionCatalog.lookupFunction(identifier).flatMap(resolvedFunction -> convertToSqlFunction(category, resolvedFunction)).ifPresent(operatorList::add);
}
Aggregations