@Override protected Double visitDoubleLiteral(DoubleLiteral node, ConnectorSession session) { return node.getValue(); }
@Override protected String visitDoubleLiteral(DoubleLiteral node, Void context) { return doubleFormatter.get().format(node.getValue()); }
@Override protected RowExpression visitDoubleLiteral(DoubleLiteral node, Void context) { return constant(node.getValue(), DOUBLE); }
private static String getValueFromLiteral(Node expression) { if (expression instanceof LongLiteral) { return String.valueOf(((LongLiteral) expression).getValue()); } else if (expression instanceof BooleanLiteral) { return String.valueOf(((BooleanLiteral) expression).getValue()); } else if (expression instanceof DoubleLiteral) { return String.valueOf(((DoubleLiteral) expression).getValue()); } else if (expression instanceof DecimalLiteral) { return String.valueOf(((DecimalLiteral) expression).getValue()); } else if (expression instanceof GenericLiteral) { return ((GenericLiteral) expression).getValue(); } else { throw new IllegalArgumentException("Unsupported literal expression type: " + expression.getClass().getName()); } }
@Override protected String visitDoubleLiteral(DoubleLiteral node, Boolean negate) { return Double.toString(node.getValue()); }
@Override protected String visitDoubleLiteral(DoubleLiteral node, Void context) { return Double.toString(node.getValue()); }
@Override protected String visitDoubleLiteral(DoubleLiteral node, Boolean unmangleNames) { String variableName = ":" + variable[1]++; valueBuilder.put(variableName, new AttributeValue().withN(Double.toString(node.getValue()))); return variableName; }
@Override protected Double visitDoubleLiteral(DoubleLiteral node, ConnectorSession session) { return node.getValue(); }
@Override protected String visitDoubleLiteral(DoubleLiteral node, Boolean unmangleNames) { return Double.toString(node.getValue()); }
@Override protected String visitDoubleLiteral(DoubleLiteral node, Boolean unmangleNames) { return Double.toString(node.getValue()); }
@Override protected String visitDoubleLiteral(DoubleLiteral node, Void context) { return doubleFormatter.get().format(node.getValue()); }
@Override protected RowExpression visitDoubleLiteral(DoubleLiteral node, Void context) { return constant(node.getValue(), DOUBLE); }
private Object getLiteralValue(Expression expression) throws SQLException{ if(expression instanceof LongLiteral) return ((LongLiteral)expression).getValue(); else if(expression instanceof BooleanLiteral) return ((BooleanLiteral)expression).getValue(); else if(expression instanceof DoubleLiteral) return ((DoubleLiteral)expression).getValue(); else if(expression instanceof StringLiteral) return ((StringLiteral)expression).getValue(); throw new SQLException("Unsupported literal type: "+expression); }
private Object getObject(Literal literal){ Object value = null; if(literal instanceof LongLiteral) value = ((LongLiteral)literal).getValue(); else if(literal instanceof BooleanLiteral) value = ((BooleanLiteral)literal).getValue(); else if(literal instanceof DoubleLiteral) value = ((DoubleLiteral)literal).getValue(); else if(literal instanceof StringLiteral) value = ((StringLiteral)literal).getValue(); else if(literal instanceof TimeLiteral) value = ((TimeLiteral)literal).getValue(); else if(literal instanceof TimestampLiteral) value = ((TimestampLiteral)literal).getValue(); return value; }
if(expression instanceof LongLiteral) return ((LongLiteral)expression).getValue(); else if(expression instanceof BooleanLiteral) return ((BooleanLiteral)expression).getValue(); else if(expression instanceof DoubleLiteral) return ((DoubleLiteral)expression).getValue(); else if(expression instanceof StringLiteral) return ((StringLiteral)expression).getValue(); else if(expression instanceof ArithmeticUnaryExpression){
return new SingleValue(((LongLiteral)node).getValue()); }else if(node instanceof DoubleLiteral){ return new SingleValue(((DoubleLiteral)node).getValue()); }else if (node instanceof ArithmeticBinaryExpression){ return visitArithmeticBinary((ArithmeticBinaryExpression)node, state);
if(compareExp.getRight() instanceof LongLiteral) value = ((LongLiteral)compareExp.getRight()).getValue(); else if(compareExp.getRight() instanceof BooleanLiteral) value = ((BooleanLiteral)compareExp.getRight()).getValue(); else if(compareExp.getRight() instanceof DoubleLiteral) value = ((DoubleLiteral)compareExp.getRight()).getValue(); else if(compareExp.getRight() instanceof StringLiteral) value = ((StringLiteral)compareExp.getRight()).getValue(); else {