public static Signature comparisonExpressionSignature( ComparisonExpression.Type expressionType, Type leftType, Type rightType) { for (OperatorType operatorType : OperatorType.values()) { if (operatorType.name().equals(expressionType.name())) { return internalOperator( expressionType.name(), parseTypeSignature(StandardTypes.BOOLEAN), leftType.getTypeSignature(), rightType.getTypeSignature()); } } return internalFunction( expressionType.name(), parseTypeSignature(StandardTypes.BOOLEAN), leftType.getTypeSignature(), rightType.getTypeSignature()); }
@Override protected Type visitArithmeticBinary(ArithmeticBinaryExpression node, AnalysisContext context) { return getOperator( context, node, OperatorType.valueOf(node.getType().name()), node.getLeft(), node.getRight()); }
@Override protected Type visitComparisonExpression(ComparisonExpression node, AnalysisContext context) { OperatorType operatorType; if (node.getType() == ComparisonExpression.Type.IS_DISTINCT_FROM) { operatorType = OperatorType.EQUAL; } else { operatorType = OperatorType.valueOf(node.getType().name()); } return getOperator(context, node, operatorType, node.getLeft(), node.getRight()); }