Search in sources :

Example 1 with OverScope

use of org.apache.calcite.sql.validate.OverScope in project calcite by apache.

the class SqlAdvisorValidator method validateOver.

protected void validateOver(SqlCall call, SqlValidatorScope scope) {
    try {
        final OverScope overScope = (OverScope) getOverScope(call);
        final SqlNode relation = call.operand(0);
        validateFrom(relation, unknownType, scope);
        final SqlNode window = call.operand(1);
        SqlValidatorScope opScope = scopes.get(relation);
        if (opScope == null) {
            opScope = overScope;
        }
        validateWindow(window, opScope, null);
    } catch (CalciteException e) {
        Util.swallow(e, TRACER);
    }
}
Also used : SqlValidatorScope(org.apache.calcite.sql.validate.SqlValidatorScope) OverScope(org.apache.calcite.sql.validate.OverScope) CalciteException(org.apache.calcite.runtime.CalciteException) SqlNode(org.apache.calcite.sql.SqlNode)

Aggregations

CalciteException (org.apache.calcite.runtime.CalciteException)1 SqlNode (org.apache.calcite.sql.SqlNode)1 OverScope (org.apache.calcite.sql.validate.OverScope)1 SqlValidatorScope (org.apache.calcite.sql.validate.SqlValidatorScope)1