@Override public Type resolve(BoundVariables boundVariables, TypeManager typeManager, FunctionRegistry functionRegistry) { return typeManager.getType(applyBoundVariables(signature, boundVariables)); }
@Override public Type getType(TypeSignature signature) { return typeManager.getType(signature); }
@Override protected Type _deserialize(String value, DeserializationContext context) { Type type = typeManager.getType(parseTypeSignature(value)); checkArgument(type != null, "Unknown type %s", value); return type; } }
@Override protected Type _deserialize(String value, DeserializationContext context) { return typeManager.getType(parseTypeSignature(value)); } }
private boolean returnTypeIsTheSame(List<ApplicableFunction> applicableFunctions) { Set<Type> returnTypes = applicableFunctions.stream() .map(function -> typeManager.getType(function.getBoundSignature().getReturnType())) .collect(Collectors.toSet()); return returnTypes.size() == 1; }
public static Optional<List<Type>> toTypes(List<TypeSignatureProvider> typeSignatureProviders, TypeManager typeManager) { ImmutableList.Builder<Type> resultBuilder = ImmutableList.builder(); for (TypeSignatureProvider typeSignatureProvider : typeSignatureProviders) { if (typeSignatureProvider.hasDependency()) { return Optional.empty(); } resultBuilder.add(typeManager.getType(typeSignatureProvider.getTypeSignature())); } return Optional.of(resultBuilder.build()); }
public static Type readType(TypeManager typeManager, SliceInput sliceInput) { requireNonNull(sliceInput, "sliceInput is null"); String name = readLengthPrefixedString(sliceInput); Type type = typeManager.getType(parseTypeSignature(name)); if (type == null) { throw new IllegalArgumentException("Unknown type " + name); } return type; }
@Override protected Type _deserialize(String value, DeserializationContext context) { return typeManager.getType(parseTypeSignature(value)); } }
@Override protected Type _deserialize(String value, DeserializationContext context) { return typeManager.getType(parseTypeSignature(value)); } }
private Type type(String signature) { TypeSignature typeSignature = TypeSignature.parseTypeSignature(signature); return requireNonNull(typeRegistry.getType(typeSignature)); }
@Override public InternalAggregationFunction specialize(BoundVariables boundVariables, int arity, TypeManager typeManager, FunctionRegistry functionRegistry) { Type type = typeManager.getType(getOnlyElement(applyBoundVariables(getSignature().getArgumentTypes(), boundVariables))); return generateAggregation(type); }
public static List<Type> getTypes(List<? extends ColumnHandle> columnHandles) { ImmutableList.Builder<Type> types = ImmutableList.builder(); for (ColumnHandle columnHandle : columnHandles) { types.add(TYPE_MANAGER.getType(((HiveColumnHandle) columnHandle).getTypeSignature())); } return types.build(); }
private boolean satisfiesCoercion(boolean allowCoercion, Type fromType, TypeSignature toTypeSignature) { if (allowCoercion) { return typeManager.canCoerce(fromType, typeManager.getType(toTypeSignature)); } else { return fromType.getTypeSignature().equals(toTypeSignature); } }
@Override public InternalAggregationFunction specialize(BoundVariables boundVariables, int arity, TypeManager typeManager, FunctionRegistry functionRegistry) { Type type = typeManager.getType(getOnlyElement(applyBoundVariables(getSignature().getArgumentTypes(), boundVariables))); return generateAggregation(type); }
public static List<Type> getTypes(List<? extends ColumnHandle> columnHandles) { ImmutableList.Builder<Type> types = ImmutableList.builder(); for (ColumnHandle columnHandle : columnHandles) { types.add(TYPE_MANAGER.getType(((HiveColumnHandle) columnHandle).getTypeSignature())); } return types.build(); }
private void assertTypeTranslation(String typeName, HiveType hiveType) { Type type = TYPE_MANAGER.getType(parseTypeSignature(typeName)); assertEquals(HiveType.toHiveType(typeTranslator, type), hiveType); }
private void assertTypeTranslation(String typeName, HiveType hiveType) { Type type = TYPE_MANAGER.getType(parseTypeSignature(typeName)); assertEquals(HiveType.toHiveType(typeTranslator, type), hiveType); }
private String canonicalizeTypeName(String type) { TypeSignature typeSignature = TypeSignature.parseTypeSignature(type); return canonicalizeType(TYPE_MANAGER.getType(typeSignature)).toString(); }
private String canonicalizeTypeName(String type) { TypeSignature typeSignature = TypeSignature.parseTypeSignature(type); return canonicalizeType(TYPE_MANAGER.getType(typeSignature)).toString(); }
@Test public void testDisplayName() { TypeManager typeManager = new TypeRegistry(); Type function = typeManager.getType(TypeSignature.parseTypeSignature("function<row(field double),bigint>")); assertEquals(function.getDisplayName(), "function<row(field double),bigint>"); } }