public SqlMonotonicity getOperandMonotonicity(int ordinal) { return call.getOperandList().get(ordinal).getMonotonicity(scope); }
public SqlMonotonicity getOperandMonotonicity(int ordinal) { return call.getOperandList().get(ordinal).getMonotonicity(scope); }
public SqlMonotonicity getMonotonicity(SqlNode expr) { SqlMonotonicity monotonicity = expr.getMonotonicity(this); if (monotonicity != SqlMonotonicity.NOT_MONOTONIC) { return monotonicity; } if (children.size() == 1) { final SqlValidatorNamespace child = children.get(0).namespace; final List<Pair<SqlNode, SqlMonotonicity>> monotonicExprs = child.getMonotonicExprs(); for (Pair<SqlNode, SqlMonotonicity> pair : monotonicExprs) { if (expr.equalsDeep(pair.left, Litmus.IGNORE)) { return pair.right; } } } return super.getMonotonicity(expr); } }
public SqlMonotonicity getMonotonicity(SqlNode expr) { SqlMonotonicity monotonicity = expr.getMonotonicity(this); if (monotonicity != SqlMonotonicity.NOT_MONOTONIC) { return monotonicity; } if (children.size() == 1) { final SqlValidatorNamespace child = children.get(0).namespace; final List<Pair<SqlNode, SqlMonotonicity>> monotonicExprs = child.getMonotonicExprs(); for (Pair<SqlNode, SqlMonotonicity> pair : monotonicExprs) { if (expr.equalsDeep(pair.left, Litmus.IGNORE)) { return pair.right; } } } return super.getMonotonicity(expr); } }
for (SqlNode selectItem : selectList) { bb.columnMonotonicities.add( selectItem.getMonotonicity(bb.scope));
for (SqlNode selectItem : selectList) { bb.columnMonotonicities.add( selectItem.getMonotonicity(bb.scope));
for (SqlNode selectItem : selectList) { bb.columnMonotonicities.add( selectItem.getMonotonicity(bb.scope));
for (SqlNode selectItem : selectList) { bb.columnMonotonicities.add( selectItem.getMonotonicity(bb.scope));
public SqlMonotonicity getMonotonicity(SqlNode expr) { SqlMonotonicity monotonicity = expr.getMonotonicity(this); if (monotonicity != SqlMonotonicity.NOT_MONOTONIC) { return monotonicity; } // TODO: compare fully qualified names final SqlNodeList orderList = getOrderList(); if (orderList.size() > 0) { SqlNode order0 = orderList.get(0); monotonicity = SqlMonotonicity.INCREASING; if ((order0 instanceof SqlCall) && (((SqlCall) order0).getOperator() == SqlStdOperatorTable.DESC)) { monotonicity = monotonicity.reverse(); order0 = ((SqlCall) order0).operand(0); } if (expr.equalsDeep(order0, Litmus.IGNORE)) { return monotonicity; } } return SqlMonotonicity.NOT_MONOTONIC; }
public SqlMonotonicity getMonotonicity(SqlNode expr) { SqlMonotonicity monotonicity = expr.getMonotonicity(this); if (monotonicity != SqlMonotonicity.NOT_MONOTONIC) { return monotonicity; } // TODO: compare fully qualified names final SqlNodeList orderList = getOrderList(); if (orderList.size() > 0) { SqlNode order0 = orderList.get(0); monotonicity = SqlMonotonicity.INCREASING; if ((order0 instanceof SqlCall) && (((SqlCall) order0).getOperator() == SqlStdOperatorTable.DESC)) { monotonicity = monotonicity.reverse(); order0 = ((SqlCall) order0).operand(0); } if (expr.equalsDeep(order0, Litmus.IGNORE)) { return monotonicity; } } return SqlMonotonicity.NOT_MONOTONIC; }
public SqlMonotonicity getMonotonicity(String sql) { final SqlValidator validator = getValidator(); final SqlNode node = parseAndValidate(validator, sql); final SqlSelect select = (SqlSelect) node; final SqlNode selectItem0 = select.getSelectList().get(0); final SqlValidatorScope scope = validator.getSelectScope(select); return selectItem0.getMonotonicity(scope); }
public SqlMonotonicity getMonotonicity(String sql) { final SqlValidator validator = getValidator(); final SqlNode node = parseAndValidate(validator, sql); final SqlSelect select = (SqlSelect) node; final SqlNode selectItem0 = select.getSelectList().get(0); final SqlValidatorScope scope = validator.getSelectScope(select); return selectItem0.getMonotonicity(scope); }