use of com.facebook.presto.type.MapParametricType in project presto by prestodb.
the class BuiltInTypeAndFunctionNamespaceManager method instantiateParametricType.
private Type instantiateParametricType(TypeSignature signature) {
List<TypeParameter> parameters = new ArrayList<>();
for (TypeSignatureParameter parameter : signature.getParameters()) {
TypeParameter typeParameter = TypeParameter.of(parameter, functionAndTypeManager);
parameters.add(typeParameter);
}
ParametricType parametricType = parametricTypes.get(signature.getBase().toLowerCase(Locale.ENGLISH));
if (parametricType == null) {
throw new IllegalArgumentException("Unknown type " + signature);
}
if (parametricType instanceof MapParametricType) {
return ((MapParametricType) parametricType).createType(functionAndTypeManager, parameters);
}
Type instantiatedType = parametricType.createType(parameters);
// checkState(instantiatedType.equalsSignature(signature), "Instantiated parametric type name (%s) does not match expected name (%s)", instantiatedType, signature);
return instantiatedType;
}
Aggregations