Search in sources :

Example 1 with FunctionDependencyDeclarationBuilder

use of io.trino.metadata.FunctionDependencyDeclaration.FunctionDependencyDeclarationBuilder in project trino by trinodb.

the class ParametricAggregation method getFunctionDependencies.

@Override
public FunctionDependencyDeclaration getFunctionDependencies() {
    FunctionDependencyDeclarationBuilder builder = FunctionDependencyDeclaration.builder();
    declareDependencies(builder, implementations.getExactImplementations().values());
    declareDependencies(builder, implementations.getSpecializedImplementations());
    declareDependencies(builder, implementations.getGenericImplementations());
    return builder.build();
}
Also used : FunctionDependencyDeclarationBuilder(io.trino.metadata.FunctionDependencyDeclaration.FunctionDependencyDeclarationBuilder)

Example 2 with FunctionDependencyDeclarationBuilder

use of io.trino.metadata.FunctionDependencyDeclaration.FunctionDependencyDeclarationBuilder in project trino by trinodb.

the class RowToRowCast method getFunctionDependencies.

@Override
public FunctionDependencyDeclaration getFunctionDependencies(BoundSignature boundSignature) {
    List<Type> toTypes = boundSignature.getReturnType().getTypeParameters();
    List<Type> fromTypes = boundSignature.getArgumentType(0).getTypeParameters();
    FunctionDependencyDeclarationBuilder builder = FunctionDependencyDeclaration.builder();
    for (int i = 0; i < toTypes.size(); i++) {
        Type fromElementType = fromTypes.get(i);
        Type toElementType = toTypes.get(i);
        builder.addCast(fromElementType, toElementType);
    }
    return builder.build();
}
Also used : SqlTypeBytecodeExpression.constantType(io.trino.sql.gen.SqlTypeBytecodeExpression.constantType) Type(io.trino.spi.type.Type) MethodType.methodType(java.lang.invoke.MethodType.methodType) TypeVariableConstraint(io.trino.metadata.TypeVariableConstraint) FunctionDependencyDeclarationBuilder(io.trino.metadata.FunctionDependencyDeclaration.FunctionDependencyDeclarationBuilder)

Example 3 with FunctionDependencyDeclarationBuilder

use of io.trino.metadata.FunctionDependencyDeclaration.FunctionDependencyDeclarationBuilder in project trino by trinodb.

the class FormatFunction method getFunctionDependencies.

@Override
public FunctionDependencyDeclaration getFunctionDependencies(BoundSignature boundSignature) {
    FunctionDependencyDeclarationBuilder builder = FunctionDependencyDeclaration.builder();
    boundSignature.getArgumentTypes().get(1).getTypeParameters().forEach(type -> addDependencies(builder, type));
    return builder.build();
}
Also used : FunctionDependencyDeclarationBuilder(io.trino.metadata.FunctionDependencyDeclaration.FunctionDependencyDeclarationBuilder)

Example 4 with FunctionDependencyDeclarationBuilder

use of io.trino.metadata.FunctionDependencyDeclaration.FunctionDependencyDeclarationBuilder in project trino by trinodb.

the class ParametricScalar method getFunctionDependencies.

@Override
public FunctionDependencyDeclaration getFunctionDependencies() {
    FunctionDependencyDeclarationBuilder builder = FunctionDependencyDeclaration.builder();
    declareDependencies(builder, implementations.getExactImplementations().values());
    declareDependencies(builder, implementations.getSpecializedImplementations());
    declareDependencies(builder, implementations.getGenericImplementations());
    return builder.build();
}
Also used : FunctionDependencyDeclarationBuilder(io.trino.metadata.FunctionDependencyDeclaration.FunctionDependencyDeclarationBuilder)

Aggregations

FunctionDependencyDeclarationBuilder (io.trino.metadata.FunctionDependencyDeclaration.FunctionDependencyDeclarationBuilder)4 TypeVariableConstraint (io.trino.metadata.TypeVariableConstraint)1 Type (io.trino.spi.type.Type)1 SqlTypeBytecodeExpression.constantType (io.trino.sql.gen.SqlTypeBytecodeExpression.constantType)1 MethodType.methodType (java.lang.invoke.MethodType.methodType)1