@Override public Long resolve(BoundVariables boundVariables, TypeManager typeManager, FunctionRegistry functionRegistry) { return boundVariables.getLongVariable(literalName); } }
@Override public Long resolve(BoundVariables boundVariables, TypeManager typeManager, FunctionRegistry functionRegistry) { return boundVariables.getLongVariable(literalName); } }
public Long getLiteral(String name) { return boundVariables.getLongVariable(name); }
public Long getLiteral(String name) { return boundVariables.getLongVariable(name); }
@Override public ScalarFunctionImplementation specialize(BoundVariables boundVariables, int arity, TypeManager typeManager, FunctionRegistry functionRegistry) { return new ScalarFunctionImplementation( false, ImmutableList.of(valueTypeArgumentProperty(RETURN_NULL_ON_NULL)), insertArguments(METHOD_HANDLE, 0, dfaStatesLimit, dfaRetries, padSpaces, boundVariables.getLongVariable("x")), true); }
@Override public ScalarFunctionImplementation specialize(BoundVariables boundVariables, int arity, TypeManager typeManager, FunctionRegistry functionRegistry) { return new ScalarFunctionImplementation( false, ImmutableList.of(valueTypeArgumentProperty(RETURN_NULL_ON_NULL)), insertArguments(METHOD_HANDLE, 0, dfaStatesLimit, dfaRetries, padSpaces, boundVariables.getLongVariable("x")), true); }
private static TypeSignatureParameter applyBoundVariables(TypeSignatureParameter parameter, BoundVariables boundVariables) { ParameterKind parameterKind = parameter.getKind(); switch (parameterKind) { case TYPE: { TypeSignature typeSignature = parameter.getTypeSignature(); return TypeSignatureParameter.of(applyBoundVariables(typeSignature, boundVariables)); } case NAMED_TYPE: { NamedTypeSignature namedTypeSignature = parameter.getNamedTypeSignature(); TypeSignature typeSignature = namedTypeSignature.getTypeSignature(); return TypeSignatureParameter.of(new NamedTypeSignature( namedTypeSignature.getFieldName(), applyBoundVariables(typeSignature, boundVariables))); } case VARIABLE: { String variableName = parameter.getVariable(); checkState(boundVariables.containsLongVariable(variableName), "Variable is not bound: %s", variableName); Long variableValue = boundVariables.getLongVariable(variableName); return TypeSignatureParameter.of(variableValue); } case LONG: { return parameter; } default: throw new IllegalStateException("Unknown parameter kind: " + parameter.getKind()); } }
private static TypeSignatureParameter applyBoundVariables(TypeSignatureParameter parameter, BoundVariables boundVariables) { ParameterKind parameterKind = parameter.getKind(); switch (parameterKind) { case TYPE: { TypeSignature typeSignature = parameter.getTypeSignature(); return TypeSignatureParameter.of(applyBoundVariables(typeSignature, boundVariables)); } case NAMED_TYPE: { NamedTypeSignature namedTypeSignature = parameter.getNamedTypeSignature(); TypeSignature typeSignature = namedTypeSignature.getTypeSignature(); return TypeSignatureParameter.of(new NamedTypeSignature( namedTypeSignature.getFieldName(), applyBoundVariables(typeSignature, boundVariables))); } case VARIABLE: { String variableName = parameter.getVariable(); checkState(boundVariables.containsLongVariable(variableName), "Variable is not bound: %s", variableName); Long variableValue = boundVariables.getLongVariable(variableName); return TypeSignatureParameter.of(variableValue); } case LONG: { return parameter; } default: throw new IllegalStateException("Unknown parameter kind: " + parameter.getKind()); } }