本文整理汇总了Java中org.apache.calcite.rel.type.RelDataTypePrecedenceList类的典型用法代码示例。如果您正苦于以下问题:Java RelDataTypePrecedenceList类的具体用法?Java RelDataTypePrecedenceList怎么用?Java RelDataTypePrecedenceList使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
RelDataTypePrecedenceList类属于org.apache.calcite.rel.type包,在下文中一共展示了RelDataTypePrecedenceList类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getPrecedenceList
import org.apache.calcite.rel.type.RelDataTypePrecedenceList; //导入依赖的package包/类
@Override public RelDataTypePrecedenceList getPrecedenceList() {
return new RelDataTypePrecedenceList() {
public boolean containsType(RelDataType type) {
return type.getSqlTypeName() == getSqlTypeName()
&& type.getComponentType() != null
&& getComponentType().getPrecedenceList().containsType(
type.getComponentType());
}
public int compareTypePrecedence(RelDataType type1, RelDataType type2) {
if (!containsType(type1)) {
throw new IllegalArgumentException("must contain type: " + type1);
}
if (!containsType(type2)) {
throw new IllegalArgumentException("must contain type: " + type2);
}
return getComponentType().getPrecedenceList()
.compareTypePrecedence(type1.getComponentType(), type2.getComponentType());
}
};
}
示例2: getPrecedenceList
import org.apache.calcite.rel.type.RelDataTypePrecedenceList; //导入依赖的package包/类
public RelDataTypePrecedenceList getPrecedenceList() {
RelDataTypePrecedenceList list =
SqlTypeExplicitPrecedenceList.getListForType(this);
if (list != null) {
return list;
}
return super.getPrecedenceList();
}
示例3: getListForType
import org.apache.calcite.rel.type.RelDataTypePrecedenceList; //导入依赖的package包/类
static RelDataTypePrecedenceList getListForType(RelDataType type) {
SqlTypeName typeName = type.getSqlTypeName();
if (typeName == null) {
return null;
}
return TYPE_NAME_TO_PRECEDENCE_LIST.get(typeName);
}
示例4: filterRoutinesByTypePrecedence
import org.apache.calcite.rel.type.RelDataTypePrecedenceList; //导入依赖的package包/类
/**
* @see Glossary#SQL99 SQL:1999 Part 2 Section 9.4
*/
private static Iterator<SqlOperator> filterRoutinesByTypePrecedence(
SqlSyntax sqlSyntax,
Iterator<SqlOperator> routines,
List<RelDataType> argTypes) {
if (sqlSyntax != SqlSyntax.FUNCTION) {
return routines;
}
List<SqlFunction> sqlFunctions =
Lists.newArrayList(Iterators.filter(routines, SqlFunction.class));
for (final Ord<RelDataType> argType : Ord.zip(argTypes)) {
final RelDataTypePrecedenceList precList =
argType.e.getPrecedenceList();
final RelDataType bestMatch = bestMatch(sqlFunctions, argType.i, precList);
if (bestMatch != null) {
sqlFunctions =
Lists.newArrayList(
Iterables.filter(sqlFunctions,
new PredicateImpl<SqlFunction>() {
public boolean test(SqlFunction function) {
final List<RelDataType> paramTypes = function.getParamTypes();
if (paramTypes == null) {
return false;
}
final RelDataType paramType = paramTypes.get(argType.i);
return precList.compareTypePrecedence(paramType, bestMatch) >= 0;
}
}));
}
}
//noinspection unchecked
return (Iterator) sqlFunctions.iterator();
}
示例5: getPrecedenceList
import org.apache.calcite.rel.type.RelDataTypePrecedenceList; //导入依赖的package包/类
@Override
public RelDataTypePrecedenceList getPrecedenceList() {
return new SqlTypeExplicitPrecedenceList((List) Collections.emptyList());
}
示例6: getPrecedenceList
import org.apache.calcite.rel.type.RelDataTypePrecedenceList; //导入依赖的package包/类
@Override
public RelDataTypePrecedenceList getPrecedenceList() {
return new SqlTypeExplicitPrecedenceList((List<SqlTypeName>) (List) Collections.emptyList());
}
示例7: getPrecedenceList
import org.apache.calcite.rel.type.RelDataTypePrecedenceList; //导入依赖的package包/类
@Override
public RelDataTypePrecedenceList getPrecedenceList() {
return new SqlTypeExplicitPrecedenceList(Collections.<SqlTypeName>emptyList());
}
示例8: getPrecedenceList
import org.apache.calcite.rel.type.RelDataTypePrecedenceList; //导入依赖的package包/类
public RelDataTypePrecedenceList getPrecedenceList() {
return delegate.getPrecedenceList();
}