コード例 #1
0
ファイル: Signatures.java プロジェクト: Rokum/presto
 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());
 }
コード例 #2
0
 @Override
 protected Type visitArithmeticBinary(ArithmeticBinaryExpression node, AnalysisContext context) {
   return getOperator(
       context,
       node,
       OperatorType.valueOf(node.getType().name()),
       node.getLeft(),
       node.getRight());
 }
コード例 #3
0
 @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());
 }