@Override protected R visitNullIfExpression(NullIfExpression node, C context) { process(node.getFirst(), context); process(node.getSecond(), context); return null; }
@Override protected String visitNullIfExpression(NullIfExpression node, Void context) { return "NULLIF(" + process(node.getFirst(), context) + ", " + process(node.getSecond(), context) + ')'; }
@Override protected Boolean visitNullIfExpression(NullIfExpression node, Void context) { return process(node.getFirst(), context) && process(node.getSecond(), context); }
@Override protected Type visitNullIfExpression(NullIfExpression node, StackableAstVisitorContext<Context> context) { Type firstType = process(node.getFirst(), context); Type secondType = process(node.getSecond(), context); if (!typeManager.getCommonSuperType(firstType, secondType).isPresent()) { throw new SemanticException(TYPE_MISMATCH, node, "Types are not comparable with NULLIF: %s vs %s", firstType, secondType); } return setExpressionType(node, firstType); }
@Override protected RowExpression visitNullIfExpression(NullIfExpression node, Void context) { RowExpression first = process(node.getFirst(), context); RowExpression second = process(node.getSecond(), context); return call( nullIfSignature(getType(node), first.getType(), second.getType()), getType(node), first, second); }
@Override protected String visitNullIfExpression(NullIfExpression node, Void context) { return "NULLIF(" + process(node.getFirst(), context) + ", " + process(node.getSecond(), context) + ')'; }
@Override protected String visitNullIfExpression(NullIfExpression node, Void context) { return "NULLIF(" + process(node.getFirst(), context) + ", " + process(node.getSecond(), context) + ')'; }
@Override protected String visitNullIfExpression(NullIfExpression node, Boolean unmangleNames) { return "NULLIF(" + process(node.getFirst(), unmangleNames) + ", " + process(node.getSecond(), unmangleNames) + ')'; }
@Override protected Boolean visitNullIfExpression(NullIfExpression node, Void context) { return process(node.getFirst(), context) && process(node.getSecond(), context); }
@Override protected R visitNullIfExpression(NullIfExpression node, C context) { process(node.getFirst(), context); process(node.getSecond(), context); return null; }
@Override protected String visitNullIfExpression(NullIfExpression node, Boolean unmangleNames) { return "NULLIF(" + process(node.getFirst(), unmangleNames) + ", " + process(node.getSecond(), unmangleNames) + ')'; }
@Override protected R visitNullIfExpression(NullIfExpression node, C context) { process(node.getFirst(), context); process(node.getSecond(), context); return null; }
@Override protected Type visitNullIfExpression(NullIfExpression node, StackableAstVisitorContext<AnalysisContext> context) { Type firstType = process(node.getFirst(), context); Type secondType = process(node.getSecond(), context); if (!getCommonSuperTypeSignature(firstType.getTypeSignature(), secondType.getTypeSignature()).isPresent()) { throw new SemanticException(TYPE_MISMATCH, node, "Types are not comparable with NULLIF: %s vs %s", firstType, secondType); } expressionTypes.put(node, firstType); return firstType; }
@Override protected RowExpression visitNullIfExpression(NullIfExpression node, Void context) { RowExpression first = process(node.getFirst(), context); RowExpression second = process(node.getSecond(), context); return call( nullIfSignature(types.get(node), first.getType(), second.getType()), types.get(node), first, second); }