Comparable value = literal.getValue();
static int compareCoordinates(RexNode coord1, RexNode coord2) { assert (coord1 instanceof RexLiteral); assert (coord2 instanceof RexLiteral); // null values always sort lowest boolean isNull1 = RexLiteral.isNullLiteral(coord1); boolean isNull2 = RexLiteral.isNullLiteral(coord2); if (isNull1 && isNull2) { return 0; } else if (isNull1) { return -1; } else if (isNull2) { return 1; } else { RexLiteral lit1 = (RexLiteral) coord1; RexLiteral lit2 = (RexLiteral) coord2; return lit1.getValue().compareTo(lit2.getValue()); } }
static int compareCoordinates(RexNode coord1, RexNode coord2) { assert coord1 instanceof RexLiteral; assert coord2 instanceof RexLiteral; // null values always sort lowest boolean isNull1 = RexLiteral.isNullLiteral(coord1); boolean isNull2 = RexLiteral.isNullLiteral(coord2); if (isNull1 && isNull2) { return 0; } else if (isNull1) { return -1; } else if (isNull2) { return 1; } else { RexLiteral lit1 = (RexLiteral) coord1; RexLiteral lit2 = (RexLiteral) coord2; return lit1.getValue().compareTo(lit2.getValue()); } }
/** * Returns the selectivity value stored in the rexnode * * @param artificialSelecFuncNode rexnode containing the selectivity value * @return selectivity value */ public static double getSelectivityValue(RexNode artificialSelecFuncNode) { assert artificialSelecFuncNode instanceof RexCall; RexCall call = (RexCall) artificialSelecFuncNode; assert call.getOperator() == ARTIFICIAL_SELECTIVITY_FUNC; RexNode operand = call.getOperands().get(0); BigDecimal bd = (BigDecimal) ((RexLiteral) operand).getValue(); return bd.doubleValue(); }
/** * Returns the selectivity value stored in the rexnode * * @param artificialSelecFuncNode rexnode containing the selectivity value * * @return selectivity value */ public static double getSelectivityValue(RexNode artificialSelecFuncNode) { assert (artificialSelecFuncNode instanceof RexCall); RexCall call = (RexCall) artificialSelecFuncNode; assert (call.getOperator() == artificialSelectivityFunc); RexNode operand = call.getOperands().get(0); BigDecimal bd = (BigDecimal) ((RexLiteral) operand).getValue(); return bd.doubleValue(); }
literal.getTypeName())) { return SqlLiteral.createExactNumeric( literal.getValue().toString(), SqlParserPos.ZERO); literal.getTypeName())) { return SqlLiteral.createApproxNumeric( literal.getValue().toString(), SqlParserPos.ZERO); literal.getTypeName())) { return SqlLiteral.createTimestamp( (Calendar) literal.getValue(), 0, SqlParserPos.ZERO); literal.getTypeName())) { return SqlLiteral.createDate( (Calendar) literal.getValue(), SqlParserPos.ZERO); literal.getTypeName())) { return SqlLiteral.createCharString( ((NlsString) (literal.getValue())).getValue(), SqlParserPos.ZERO); literal.getTypeName())) { return SqlLiteral.createBoolean( (Boolean) literal.getValue(),
RexLiteral literal = (RexLiteral) node; if (literal.getTypeName() == SqlTypeName.NULL) { assert null == literal.getValue(); return true; } else {
RexLiteral literal = (RexLiteral) node; if (literal.getTypeName() == SqlTypeName.NULL) { assert (null == literal.getValue()); return true; } else {
literal.getValue().toString(), SqlParserPos.ZERO); literal.getValue().toString(), SqlParserPos.ZERO); (Calendar) literal.getValue(), 0, SqlParserPos.ZERO); (Calendar) literal.getValue(), SqlParserPos.ZERO); ((NlsString) (literal.getValue())).getValue(), SqlParserPos.ZERO); (Boolean) literal.getValue(), SqlParserPos.ZERO);
public RexNode visitLiteral(RexLiteral literal) { return new RexLiteral( literal.getValue(), builder.getTypeFactory().copyType(literal.getType()), literal.getTypeName()); }
public RexNode visitLiteral(RexLiteral literal) { return new RexLiteral( literal.getValue(), builder.getTypeFactory().copyType(literal.getType()), literal.getTypeName()); }
private boolean strong(RexNode node) { switch (node.getKind()) { case LITERAL: return ((RexLiteral) node).getValue() == null; case IS_TRUE: case IS_NOT_NULL: case AND: case EQUALS: case NOT_EQUALS: case LESS_THAN: case LESS_THAN_OR_EQUAL: case GREATER_THAN: case GREATER_THAN_OR_EQUAL: return anyStrong(((RexCall) node).getOperands()); case OR: return allStrong(((RexCall) node).getOperands()); case INPUT_REF: return nullColumns.get(((RexInputRef) node).getIndex()); default: return false; } }
Comparable value = literal.getValue(); int roundingCompensation;
Comparable value = literal.getValue(); int roundingCompensation;
Comparable value = literal.getValue();
Comparable value = literal.getValue();
if (exp instanceof RexLiteral) { RexLiteral literal = (RexLiteral) exp; Comparable value = literal.getValue(); if (RexLiteral.valueMatchesType(value, sqlType, false) && (!(value instanceof NlsString)
if (exp instanceof RexLiteral) { RexLiteral literal = (RexLiteral) exp; Comparable value = literal.getValue(); if (RexLiteral.valueMatchesType(value, sqlType, false) && (!(value instanceof NlsString)
(RexLiteral) cx.convertExpression(node); long sourceValue = ((BigDecimal) sourceInterval.getValue()).longValue(); SqlIntervalQualifier intervalQualifier = (SqlIntervalQualifier) call.operands[1];
(RexLiteral) cx.convertExpression(left); BigDecimal sourceValue = (BigDecimal) sourceInterval.getValue(); RexLiteral castedInterval = cx.getRexBuilder().makeIntervalLiteral(