public SqlMonotonicity getMonotonicity(String columnName) { return namespace.getMonotonicity(columnName); }
public SqlMonotonicity getMonotonicity(String columnName) { return namespace.getMonotonicity(columnName); }
@Override public SqlMonotonicity getMonotonicity(String columnName) { SqlMonotonicity monotonicity = null; int index = getRowType().getFieldNames().indexOf(columnName); if (index < 0) { return SqlMonotonicity.NOT_MONOTONIC; } for (SqlNode operand : call.getOperandList()) { final SqlValidatorNamespace namespace = validator.getNamespace(operand); monotonicity = combine(monotonicity, namespace.getMonotonicity( namespace.getRowType().getFieldNames().get(index))); } return monotonicity; }
@Override public SqlMonotonicity getMonotonicity(String columnName) { SqlMonotonicity monotonicity = null; int index = getRowType().getFieldNames().indexOf(columnName); if (index < 0) { return SqlMonotonicity.NOT_MONOTONIC; } for (SqlNode operand : call.getOperandList()) { final SqlValidatorNamespace namespace = validator.getNamespace(operand); monotonicity = combine(monotonicity, namespace.getMonotonicity( namespace.getRowType().getFieldNames().get(index))); } return monotonicity; }
final String fieldName = field.getName(); final SqlMonotonicity monotonicity = resolvedNamespace.getMonotonicity(fieldName); if (monotonicity != SqlMonotonicity.NOT_MONOTONIC) { builder.add(
final String fieldName = field.getName(); final SqlMonotonicity monotonicity = resolvedNamespace.getMonotonicity(fieldName); if (monotonicity != SqlMonotonicity.NOT_MONOTONIC) { builder.add(
/** * Returns whether there are any input columns that are sorted. * * <p>If so, it can be the default ORDER BY clause for a WINDOW specification. * (This is an extension to the SQL standard for streaming.) */ public static boolean containsMonotonic(SqlValidatorScope scope) { for (SqlValidatorNamespace ns : children(scope)) { ns = ns.resolve(); for (String field : ns.getRowType().getFieldNames()) { if (!ns.getMonotonicity(field).mayRepeat()) { return true; } } } return false; }
/** * Returns whether there are any input columns that are sorted. * * <p>If so, it can be the default ORDER BY clause for a WINDOW specification. * (This is an extension to the SQL standard for streaming.) */ public static boolean containsMonotonic(SqlValidatorScope scope) { for (SqlValidatorNamespace ns : children(scope)) { ns = ns.resolve(); for (String field : ns.getRowType().getFieldNames()) { if (!ns.getMonotonicity(field).mayRepeat()) { return true; } } } return false; }
public SqlMonotonicity getMonotonicity(SqlValidatorScope scope) { // for "star" column, whether it's static or dynamic return not_monotonic directly. if (Util.last(names).equals("") || DynamicRecordType.isDynamicStarColName(Util.last(names))) { return SqlMonotonicity.NOT_MONOTONIC; } // First check for builtin functions which don't have parentheses, // like "LOCALTIME". final SqlValidator validator = scope.getValidator(); SqlCall call = SqlUtil.makeCall( validator.getOperatorTable(), this); if (call != null) { return call.getMonotonicity(scope); } final SqlQualified qualified = scope.fullyQualify(this); final SqlIdentifier fqId = qualified.identifier; return qualified.namespace.resolve().getMonotonicity(Util.last(fqId.names)); } }
public void checkMonotonic(String query, SqlMonotonicity expectedMonotonicity) { SqlValidator validator = getValidator(); SqlNode n = parseAndValidate(validator, query); final RelDataType rowType = validator.getValidatedNodeType(n); final SqlValidatorNamespace selectNamespace = validator.getNamespace(n); final String field0 = rowType.getFieldList().get(0).getName(); final SqlMonotonicity monotonicity = selectNamespace.getMonotonicity(field0); assertThat(monotonicity, equalTo(expectedMonotonicity)); }
public void checkMonotonic(String query, SqlMonotonicity expectedMonotonicity) { SqlValidator validator = getValidator(); SqlNode n = parseAndValidate(validator, query); final RelDataType rowType = validator.getValidatedNodeType(n); final SqlValidatorNamespace selectNamespace = validator.getNamespace(n); final String field0 = rowType.getFieldList().get(0).getName(); final SqlMonotonicity monotonicity = selectNamespace.getMonotonicity(field0); assertThat(monotonicity, equalTo(expectedMonotonicity)); }
public SqlMonotonicity getMonotonicity(SqlValidatorScope scope) { // for "star" column, whether it's static or dynamic return not_monotonic directly. if (Util.last(names).equals("") || DynamicRecordType.isDynamicStarColName(Util.last(names))) { return SqlMonotonicity.NOT_MONOTONIC; } // First check for builtin functions which don't have parentheses, // like "LOCALTIME". final SqlValidator validator = scope.getValidator(); SqlCall call = SqlUtil.makeCall( validator.getOperatorTable(), this); if (call != null) { return call.getMonotonicity(scope); } final SqlQualified qualified = scope.fullyQualify(this); final SqlIdentifier fqId = qualified.identifier; return qualified.namespace.resolve().getMonotonicity(Util.last(fqId.names)); } }