@Override protected Object visitBooleanLiteral(BooleanLiteral node, ConnectorSession session) { return node.getValue(); }
@Override protected Void visitBooleanLiteral(BooleanLiteral node, Integer indentLevel) { print(indentLevel, "Boolean[" + node.getValue() + "]"); return null; }
@Override protected String visitBooleanLiteral(BooleanLiteral node, Void context) { return String.valueOf(node.getValue()); }
@Override protected RowExpression visitBooleanLiteral(BooleanLiteral node, Void context) { return constant(node.getValue(), BOOLEAN); }
@Override protected PlanNodeStatsEstimate visitBooleanLiteral(BooleanLiteral node, Void context) { if (node.getValue()) { return input; } PlanNodeStatsEstimate.Builder result = PlanNodeStatsEstimate.builder(); result.setOutputRowCount(0.0); input.getSymbolsWithKnownStatistics().forEach(symbol -> result.addSymbolStatistics(symbol, SymbolStatsEstimate.zero())); return result.build(); }
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 visitBooleanLiteral(BooleanLiteral node, Void context) { return String.valueOf(node.getValue()); }
@Override protected String visitBooleanLiteral(BooleanLiteral node, Boolean negate) { return String.valueOf(node.getValue()); }
@Override protected String visitBooleanLiteral(BooleanLiteral node, Boolean unmangleNames) { String variableName = ":" + variable[1]++; valueBuilder.put(variableName, new AttributeValue().withBOOL(node.getValue())); return variableName; }
@Override protected Void visitBooleanLiteral(BooleanLiteral node, Integer indentLevel) { print(indentLevel, "Boolean[" + node.getValue() + "]"); return null; }
@Override protected Object visitBooleanLiteral(BooleanLiteral node, ConnectorSession session) { return node.getValue(); }
@Override protected Void visitBooleanLiteral(BooleanLiteral node, Integer indentLevel) { print(indentLevel, "Boolean[" + node.getValue() + "]"); return null; }
@Override protected String visitBooleanLiteral(BooleanLiteral node, Boolean unmangleNames) { return String.valueOf(node.getValue()); }
@Override protected String visitBooleanLiteral(BooleanLiteral node, Void context) { return String.valueOf(node.getValue()); }
@Override protected String visitBooleanLiteral(BooleanLiteral node, Boolean unmangleNames) { return String.valueOf(node.getValue()); }
@Override protected RowExpression visitBooleanLiteral(BooleanLiteral node, Void context) { return constant(node.getValue(), BOOLEAN); }
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; }