private static RelDataType bestMatch(List<SqlFunction> sqlFunctions, int i, RelDataTypePrecedenceList precList) { RelDataType bestMatch = null; for (SqlFunction function : sqlFunctions) { List<RelDataType> paramTypes = function.getParamTypes(); if (paramTypes == null) { continue; } final RelDataType paramType = paramTypes.get(i); if (bestMatch == null) { bestMatch = paramType; } else { int c = precList.compareTypePrecedence( bestMatch, paramType); if (c < 0) { bestMatch = paramType; } } } return bestMatch; }
public boolean containsType(RelDataType type) { return type.getSqlTypeName() == getSqlTypeName() && type.getComponentType() != null && getComponentType().getPrecedenceList().containsType( type.getComponentType()); }
public boolean containsType(RelDataType type) { return type.getSqlTypeName() == getSqlTypeName() && type.getComponentType() != null && getComponentType().getPrecedenceList().containsType( type.getComponentType()); }
private static RelDataType bestMatch(List<SqlFunction> sqlFunctions, int i, RelDataTypePrecedenceList precList) { RelDataType bestMatch = null; for (SqlFunction function : sqlFunctions) { List<RelDataType> paramTypes = function.getParamTypes(); if (paramTypes == null) { continue; } final RelDataType paramType = paramTypes.get(i); if (bestMatch == null) { bestMatch = paramType; } else { int c = precList.compareTypePrecedence( bestMatch, paramType); if (c < 0) { bestMatch = paramType; } } } return bestMatch; }
public boolean containsType(RelDataType type) { return type.getSqlTypeName() == getSqlTypeName() && type.getComponentType() != null && getComponentType().getPrecedenceList().containsType( type.getComponentType()); }
return precList.compareTypePrecedence(paramType, bestMatch) >= 0; }) .collect(Collectors.toList());
public boolean containsType(RelDataType type) { return type.getSqlTypeName() == getSqlTypeName() && type.getComponentType() != null && getComponentType().getPrecedenceList().containsType( type.getComponentType()); }
return precList.compareTypePrecedence(paramType, bestMatch) >= 0; }) .collect(Collectors.toList());
private int checkPrecendenceList(RelDataType t, RelDataType type1, RelDataType type2) { return t.getPrecedenceList().compareTypePrecedence(type1, type2); }
private int checkPrecendenceList(RelDataType t, RelDataType type1, RelDataType type2) { return t.getPrecedenceList().compareTypePrecedence(type1, type2); }
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()); } };
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()); } };
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()); } };
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()); } };